Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / ui / keyboard / BUILD.gn
blobad6b287d7265ce71a9945318fb69336b65729cbc
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//mojo/public/tools/bindings/mojom.gni")
6 import("//third_party/google_input_tools/closure.gni")
7 import("//third_party/google_input_tools/inputview.gni")
8 import("//tools/grit/grit_rule.gni")
10 component("keyboard") {
11   sources = [
12     "keyboard.cc",
13     "keyboard.h",
14     "keyboard_constants.cc",
15     "keyboard_constants.h",
16     "keyboard_controller.cc",
17     "keyboard_controller.h",
18     "keyboard_controller_observer.h",
19     "keyboard_controller_proxy.cc",
20     "keyboard_controller_proxy.h",
21     "keyboard_layout_manager.h",
22     "keyboard_layout_manager.cc",
23     "keyboard_export.h",
24     "keyboard_switches.cc",
25     "keyboard_switches.h",
26     "keyboard_util.cc",
27     "keyboard_util.h",
28     "webui/vk_mojo_handler.cc",
29     "webui/vk_mojo_handler.h",
30     "webui/vk_webui_controller.cc",
31     "webui/vk_webui_controller.h",
32   ]
34   defines = [ "KEYBOARD_IMPLEMENTATION" ]
36   deps = [
37     ":keyboard_mojom_bindings",
38     ":resources",
39     "//base",
40     "//base/third_party/dynamic_annotations",
41     "//content/public/browser",
42     "//content/public/common",
43     "//mojo/edk/js",
44     "//mojo/edk/system",
45     "//mojo/environment:chromium",
46     "//mojo/public/cpp/bindings",
47     "//mojo/public/cpp/system",
48     "//url",
49     "//ui/aura",
50     "//ui/base",
51     "//ui/compositor",
52     "//ui/events",
53     "//ui/gfx",
54     "//ui/gfx/geometry",
55     "//ui/wm",
56   ]
59 # GYP version: ui/keyboard/keyboard.gyp:keyboard_mojom_bindings
60 mojom("keyboard_mojom_bindings") {
61   sources = [
62     "webui/keyboard.mojom",
63   ]
66 grit("resources_grit") {
67   source = "keyboard_resources.grd"
68   outputs = [
69     "grit/keyboard_resources.h",
70     "grit/keyboard_resources_map.h",
71     "keyboard_resources.pak",
72     "keyboard_resources.rc",
73   ]
75   keyboard_mojom_gen_js = "$root_gen_dir/ui/keyboard/webui/keyboard.mojom.js"
76   inputview_dir = "../../third_party/google_input_tools/src/chrome/os/inputview"
77   inputview_gen_js = "$root_gen_dir/ui/keyboard/resources/inputview.js"
78   grit_flags = [
79     "-E", "keyboard_mojom_gen_js=" +
80           rebase_path(keyboard_mojom_gen_js, root_build_dir),
81     "-E", "inputview_dir=" +
82           rebase_path(inputview_dir, root_build_dir),
83     "-E", "inputview_gen_js=" +
84           rebase_path(inputview_gen_js, root_build_dir),
85   ]
87   deps = [
88     ":keyboard_mojom_bindings",
89     ":inputview"
90   ]
93 copy("resources") {
94   sources = [ "$target_gen_dir/keyboard_resources.pak" ]
95   outputs = [ "$root_out_dir/keyboard_resources.pak" ]
96   public_deps = [ ":resources_grit" ]
99 build_closure("inputview") {
100   sources = inputview_sources
101   target = "$target_gen_dir/resources/inputview.js"
102   json_file = "//third_party/google_input_tools/inputview.gypi"
103   sources += [ json_file ]
104   json_sources = "variables.inputview_sources"
105   path = rebase_path("//third_party/google_input_tools")
108 test("keyboard_unittests") {
109   sources = [
110     "test/run_all_unittests.cc",
111     "keyboard_controller_unittest.cc",
112   ]
114   deps = [
115     ":keyboard",
116     "//base",
117     "//base/allocator",
118     "//base/test:test_support",
119     "//content",
120     "//skia",
121     "//testing/gtest",
122     "//ui/aura:test_support",
123     "//ui/base:test_support",
124     "//ui/compositor:test_support",
125     "//ui/events:test_support",
126     "//ui/gfx",
127     "//ui/gfx/geometry",
128     "//ui/gl",
129     "//ui/resources:ui_test_pak",
130     "//ui/wm",
131     "//url",
132   ]