tools/gn: convert NULL to nullptr, header version.
[chromium-blink-merge.git] / ui / keyboard / BUILD.gn
blobbbc3cc8f636750e2b58b503ed8e373443225cf0f
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/events:dom4_keycode_converter",
54     "//ui/gfx",
55     "//ui/gfx/geometry",
56     "//ui/wm",
57   ]
60 # GYP version: ui/keyboard/keyboard.gyp:keyboard_mojom_bindings
61 mojom("keyboard_mojom_bindings") {
62   sources = [
63     "webui/keyboard.mojom",
64   ]
67 grit("resources_grit") {
68   source = "keyboard_resources.grd"
69   outputs = [
70     "grit/keyboard_resources.h",
71     "grit/keyboard_resources_map.h",
72     "keyboard_resources.pak",
73     "keyboard_resources.rc",
74   ]
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   keyboard_mojom_gen_js = "$root_gen_dir/ui/keyboard/webui/keyboard.mojom.js"
79   grit_flags = [
80     "-E",
81     "inputview_dir=" + rebase_path(inputview_dir, "."),
82     "-E",
83     "inputview_gen_js=" + rebase_path(inputview_gen_js, root_build_dir),
84     "-E",
85     "keyboard_mojom_gen_js=" +
86         rebase_path(keyboard_mojom_gen_js, root_build_dir),
87   ]
89   deps = [
90     ":inputview",
91     ":keyboard_mojom_bindings",
92   ]
95 copy("resources") {
96   sources = [
97     "$target_gen_dir/keyboard_resources.pak",
98   ]
99   outputs = [
100     "$root_out_dir/keyboard_resources.pak",
101   ]
102   public_deps = [
103     ":resources_grit",
104   ]
107 build_closure("inputview") {
108   sources = inputview_sources
109   target = "$target_gen_dir/resources/inputview.js"
110   json_file = "//third_party/google_input_tools/inputview.gypi"
111   sources += [ json_file ]
112   json_sources = "variables.inputview_sources"
113   path = rebase_path("//third_party/google_input_tools")
116 test("keyboard_unittests") {
117   sources = [
118     "test/run_all_unittests.cc",
119     "keyboard_controller_unittest.cc",
120   ]
122   deps = [
123     ":keyboard",
124     "//base",
125     "//base/allocator",
126     "//base/test:test_support",
127     "//content",
128     "//skia",
129     "//testing/gtest",
130     "//ui/aura:test_support",
131     "//ui/base:test_support",
132     "//ui/compositor:test_support",
133     "//ui/events:test_support",
134     "//ui/gfx",
135     "//ui/gfx/geometry",
136     "//ui/gl",
137     "//ui/resources:ui_test_pak",
138     "//ui/wm",
139     "//url",
140   ]