| # Copyright 2017 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//mojo/public/tools/bindings/mojom.gni") |
| |
| mojom("mojom") { |
| sources = [ "image.mojom" ] |
| |
| webui_module_path = "chrome://resources/mojo/ui/gfx/image/mojom" |
| |
| # Generate WebUI bindings in TypeScript. |
| use_typescript_sources = true |
| |
| # Used by content/common so need legacy JS bindings for Blink. |
| generate_legacy_js_bindings = true |
| |
| public_deps = [ "//skia/public/mojom" ] |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "gfx.mojom.ImageSkia" |
| cpp = "::gfx::ImageSkia" |
| nullable_is_same_type = true |
| }, |
| { |
| mojom = "gfx.mojom.ImageSkiaRep" |
| cpp = "::gfx::ImageSkiaRep" |
| }, |
| ] |
| traits_headers = [ "image_skia_mojom_traits.h" ] |
| traits_public_deps = [ ":mojom_traits" ] |
| }, |
| ] |
| } |
| |
| source_set("mojom_traits") { |
| sources = [ |
| "image_skia_mojom_traits.cc", |
| "image_skia_mojom_traits.h", |
| ] |
| |
| public_deps = [ |
| ":mojom_shared_cpp_sources", |
| "//skia/public/mojom", |
| "//ui/gfx", |
| ] |
| } |
| |
| # Using a test service because the traits need to pass handles around. Revisit |
| # this after Deserialize(Serialize()) API works with handles. |
| mojom("test_interfaces") { |
| sources = [ "image_traits_test_service.mojom" ] |
| |
| public_deps = [ ":mojom" ] |
| } |
| |
| source_set("unit_test") { |
| testonly = true |
| |
| sources = [ "image_traits_unittest.cc" ] |
| |
| deps = [ |
| ":mojom_traits", |
| ":test_interfaces", |
| "//base", |
| "//base/test:test_support", |
| "//mojo/public/cpp/bindings", |
| "//mojo/public/cpp/test_support:test_utils", |
| "//testing/gtest", |
| "//ui/gfx:test_support", |
| ] |
| } |