blob: 263cd6aafebad7e61db9abd2965ad21d01128f35 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# 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")
import("//third_party/google_input_tools/closure.gni")
import("//third_party/google_input_tools/inputview.gni")
import("//tools/grit/grit_rule.gni")
component("keyboard") {
sources = [
"keyboard.cc",
"keyboard.h",
"keyboard_constants.cc",
"keyboard_constants.h",
"keyboard_controller.cc",
"keyboard_controller.h",
"keyboard_controller_observer.h",
"keyboard_controller_proxy.cc",
"keyboard_controller_proxy.h",
"keyboard_layout_manager.h",
"keyboard_layout_manager.cc",
"keyboard_export.h",
"keyboard_switches.cc",
"keyboard_switches.h",
"keyboard_util.cc",
"keyboard_util.h",
"webui/vk_mojo_handler.cc",
"webui/vk_mojo_handler.h",
"webui/vk_webui_controller.cc",
"webui/vk_webui_controller.h",
]
defines = [ "KEYBOARD_IMPLEMENTATION" ]
deps = [
":keyboard_mojom_bindings",
":resources",
"//base",
"//base/third_party/dynamic_annotations",
"//content/public/browser",
"//content/public/common",
"//mojo/edk/js",
"//mojo/edk/system",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//url",
"//ui/aura",
"//ui/base",
"//ui/compositor",
"//ui/events",
"//ui/events:dom4_keycode_converter",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/wm",
]
}
# GYP version: ui/keyboard/keyboard.gyp:keyboard_mojom_bindings
mojom("keyboard_mojom_bindings") {
sources = [
"webui/keyboard.mojom",
]
}
grit("resources_grit") {
source = "keyboard_resources.grd"
outputs = [
"grit/keyboard_resources.h",
"grit/keyboard_resources_map.h",
"keyboard_resources.pak",
"keyboard_resources.rc",
]
inputview_dir = "//third_party/google_input_tools/src/chrome/os/inputview"
inputview_gen_js = "$root_gen_dir/ui/keyboard/resources/inputview.js"
keyboard_mojom_gen_js = "$root_gen_dir/ui/keyboard/webui/keyboard.mojom.js"
grit_flags = [
"-E", "inputview_dir=" +
rebase_path(inputview_dir, "."),
"-E", "inputview_gen_js=" +
rebase_path(inputview_gen_js, root_build_dir),
"-E", "keyboard_mojom_gen_js=" +
rebase_path(keyboard_mojom_gen_js, root_build_dir),
]
deps = [
":inputview",
":keyboard_mojom_bindings",
]
}
copy("resources") {
sources = [ "$target_gen_dir/keyboard_resources.pak" ]
outputs = [ "$root_out_dir/keyboard_resources.pak" ]
public_deps = [ ":resources_grit" ]
}
build_closure("inputview") {
sources = inputview_sources
target = "$target_gen_dir/resources/inputview.js"
json_file = "//third_party/google_input_tools/inputview.gypi"
sources += [ json_file ]
json_sources = "variables.inputview_sources"
path = rebase_path("//third_party/google_input_tools")
}
test("keyboard_unittests") {
sources = [
"test/run_all_unittests.cc",
"keyboard_controller_unittest.cc",
]
deps = [
":keyboard",
"//base",
"//base/allocator",
"//base/test:test_support",
"//content",
"//skia",
"//testing/gtest",
"//ui/aura:test_support",
"//ui/base:test_support",
"//ui/compositor:test_support",
"//ui/events:test_support",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gl",
"//ui/resources:ui_test_pak",
"//ui/wm",
"//url",
]
}