| # Copyright 2021 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("//third_party/closure_compiler/compile_js.gni") |
| import("//tools/grit/grit_rule.gni") |
| import("//tools/grit/preprocess_if_expr.gni") |
| import("//tools/polymer/html_to_js.gni") |
| import("//ui/webui/resources/tools/generate_grd.gni") |
| |
| preprocessed_dir = "preprocessed" |
| preprocessed_gen_manifest = "preprocessed_gen_manifest.json" |
| |
| polymer_element_files = [ |
| "accelerator_edit_dialog.js", |
| "accelerator_row.js", |
| "accelerator_view.js", |
| "accessibility_shortcuts_page.js", |
| "android_shortcuts_page.js", |
| "browser_shortcuts_page.js", |
| "chromeos_shortcuts_page.js", |
| "input_key.js", |
| "shortcut_customization_app.js", |
| "shortcut_input.js", |
| ] |
| |
| generate_grd("build_grd") { |
| input_files = [ |
| "index.html", |
| "app_icon_192.png", |
| ] |
| input_files_base_dir = rebase_path(".", "//") |
| deps = [ ":preprocess_generated" ] |
| manifest_files = [ "$target_gen_dir/$preprocessed_gen_manifest" ] |
| grd_prefix = "ash_shortcut_customization_app" |
| out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" |
| } |
| |
| js_type_check("closure_compile") { |
| is_polymer3 = true |
| closure_flags = default_closure_args |
| deps = [ ":shortcut_customization_app" ] |
| } |
| |
| js_library("shortcut_customization_app") { |
| deps = [ |
| ":shortcut_input", |
| "//ash/webui/common/resources:navigation_view_panel", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("input_key") { |
| deps = [ |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("shortcut_input") { |
| deps = [ |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("browser_shortcuts_page") { |
| deps = [ |
| ":shortcut_input", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("chromeos_shortcuts_page") { |
| deps = [ |
| ":shortcut_input", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("android_shortcuts_page") { |
| deps = [ |
| ":accelerator_edit_dialog", |
| ":shortcut_input", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("accessibility_shortcuts_page") { |
| deps = [ |
| ":shortcut_input", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("accelerator_view") { |
| deps = [ |
| ":input_key", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("accelerator_row") { |
| deps = [ |
| ":accelerator_view", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("accelerator_edit_dialog") { |
| deps = [ |
| ":accelerator_view", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_button:cr_button.m", |
| "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", |
| ] |
| } |
| |
| preprocess_if_expr("preprocess_generated") { |
| deps = [ ":web_components" ] |
| in_folder = target_gen_dir |
| out_folder = "$target_gen_dir/$preprocessed_dir" |
| out_manifest = "$target_gen_dir/$preprocessed_gen_manifest" |
| in_files = polymer_element_files |
| } |
| |
| html_to_js("web_components") { |
| js_files = polymer_element_files |
| } |