| # Copyright 2018 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("//build/config/chromeos/ui_mode.gni") |
| import("//third_party/closure_compiler/compile_js.gni") |
| import("//tools/polymer/html_to_js.gni") |
| |
| js_type_check("closure_compile_module") { |
| is_polymer3 = true |
| closure_flags = |
| default_closure_args + [ |
| "js_module_root=../../chrome/browser/resources/print_preview/", |
| "js_module_root=../../chrome/browser/resources/", |
| ] |
| deps = [ |
| ":advanced_options_settings", |
| ":advanced_settings_dialog", |
| ":advanced_settings_item", |
| ":app", |
| ":button_strip", |
| ":color_settings", |
| ":copies_settings", |
| ":destination_list", |
| ":destination_list_item", |
| ":destination_settings", |
| ":dpi_settings", |
| ":duplex_settings", |
| ":header", |
| ":highlight_utils", |
| ":input_behavior", |
| ":layout_settings", |
| ":link_container", |
| ":margin_control", |
| ":margin_control_container", |
| ":margins_settings", |
| ":media_size_settings", |
| ":more_settings", |
| ":number_settings_section", |
| ":other_options_settings", |
| ":pages_per_sheet_settings", |
| ":pages_settings", |
| ":plugin_proxy", |
| ":preview_area", |
| ":print_preview_search_box", |
| ":scaling_settings", |
| ":select_behavior", |
| ":settings_behavior", |
| ":settings_select", |
| ":sidebar", |
| ] |
| |
| if (is_chromeos_ash) { |
| deps += [ |
| ":destination_dialog_cros", |
| ":destination_dropdown_cros", |
| ":destination_select_cros", |
| ":pin_settings", |
| ":provisional_destination_resolver", |
| ] |
| } else { |
| deps += [ |
| ":destination_dialog", |
| ":destination_select", |
| ] |
| } |
| } |
| |
| js_library("app") { |
| deps = [ |
| ":preview_area", |
| ":sidebar", |
| "..:cloud_print_interface", |
| "..:cloud_print_interface_impl", |
| "..:native_layer", |
| "..:native_layer_cros", |
| "../data:destination", |
| "../data:document_info", |
| "../data:margins", |
| "../data:measurement_system", |
| "../data:model", |
| "../data:printable_area", |
| "../data:size", |
| "../data:state", |
| "//ui/webui/resources/js:event_tracker.m", |
| "//ui/webui/resources/js:util.m", |
| "//ui/webui/resources/js:web_ui_listener_behavior.m", |
| "//ui/webui/resources/js/cr/ui:focus_outline_manager.m", |
| ] |
| } |
| |
| js_library("sidebar") { |
| deps = [ |
| ":advanced_options_settings", |
| ":button_strip", |
| ":color_settings", |
| ":copies_settings", |
| ":destination_settings", |
| ":dpi_settings", |
| ":duplex_settings", |
| ":header", |
| ":layout_settings", |
| ":link_container", |
| ":margins_settings", |
| ":media_size_settings", |
| ":more_settings", |
| ":other_options_settings", |
| ":pages_per_sheet_settings", |
| ":pages_settings", |
| ":scaling_settings", |
| "..:dark_mode_behavior", |
| "..:metrics", |
| "../data:destination", |
| "../data:state", |
| "//ui/webui/resources/cr_elements:cr_container_shadow_behavior.m", |
| "//ui/webui/resources/js:load_time_data.m", |
| "//ui/webui/resources/js:web_ui_listener_behavior.m", |
| ] |
| } |
| |
| js_library("button_strip") { |
| deps = [ |
| "../data:destination", |
| "../data:state", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:plural_string_proxy", |
| ] |
| |
| if (is_chromeos_ash) { |
| deps += [ ":pin_settings" ] |
| } |
| } |
| |
| js_library("header") { |
| deps = [ |
| ":settings_behavior", |
| "../data:destination", |
| "../data:state", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:load_time_data.m", |
| "//ui/webui/resources/js:plural_string_proxy", |
| ] |
| } |
| |
| js_library("destination_settings") { |
| deps = [ |
| ":settings_behavior", |
| "..:cloud_print_interface_impl", |
| "../data:destination", |
| "../data:destination_store", |
| "../data:invitation_store", |
| "../data:state", |
| "../data:user_manager", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_lazy_render:cr_lazy_render.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| "//ui/webui/resources/js:web_ui_listener_behavior.m", |
| ] |
| |
| if (is_chromeos_ash) { |
| deps += [ |
| ":destination_dialog_cros", |
| ":destination_select_cros", |
| ] |
| } else { |
| deps += [ |
| ":destination_dialog", |
| ":destination_select", |
| ] |
| } |
| } |
| |
| if (is_chromeos_ash) { |
| js_library("destination_select_cros") { |
| deps = [ |
| ":destination_dropdown_cros", |
| ":select_behavior", |
| "..:print_preview_utils", |
| "../data:destination", |
| "../data:printer_status_cros", |
| "//third_party/polymer/v3_0/components-chromium/iron-iconset-svg:iron-iconset-svg", |
| "//third_party/polymer/v3_0/components-chromium/iron-meta:iron-meta", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| |
| js_library("pin_settings") { |
| deps = [ |
| ":input_behavior", |
| ":settings_behavior", |
| "../data:state", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("destination_dropdown_cros") { |
| deps = [ |
| "..:print_preview_utils", |
| "//third_party/polymer/v3_0/components-chromium/iron-dropdown:iron-dropdown", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_input:cr_input.m", |
| ] |
| } |
| } else { |
| js_library("destination_select") { |
| deps = [ |
| ":select_behavior", |
| "..:print_preview_utils", |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/iron-iconset-svg:iron-iconset-svg", |
| "//third_party/polymer/v3_0/components-chromium/iron-meta:iron-meta", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| } |
| |
| js_library("pages_settings") { |
| deps = [ |
| ":input_behavior", |
| ":settings_behavior", |
| "..:print_preview_utils", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_input:cr_input.m", |
| "//ui/webui/resources/js:load_time_data.m", |
| ] |
| } |
| |
| js_library("copies_settings") { |
| deps = [ |
| ":number_settings_section", |
| ":settings_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("layout_settings") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("color_settings") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("media_size_settings") { |
| deps = [ |
| ":settings_behavior", |
| ":settings_select", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("margins_settings") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "../data:margins", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("dpi_settings") { |
| deps = [ |
| ":settings_behavior", |
| ":settings_select", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:assert.m", |
| "//ui/webui/resources/js:load_time_data.m", |
| ] |
| } |
| |
| js_library("pages_per_sheet_settings") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("scaling_settings") { |
| deps = [ |
| ":number_settings_section", |
| ":select_behavior", |
| ":settings_behavior", |
| "../data:scaling", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:load_time_data.m", |
| ] |
| } |
| |
| js_library("other_options_settings") { |
| deps = [ |
| ":settings_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| |
| js_library("duplex_settings") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "..:print_preview_utils", |
| "../data:model", |
| "//third_party/polymer/v3_0/components-chromium/iron-collapse:iron-collapse", |
| "//third_party/polymer/v3_0/components-chromium/iron-iconset-svg:iron-iconset-svg", |
| "//third_party/polymer/v3_0/components-chromium/iron-meta:iron-meta", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_checkbox:cr_checkbox.m", |
| ] |
| } |
| |
| js_library("advanced_options_settings") { |
| deps = [ |
| ":advanced_settings_dialog", |
| "../data:destination", |
| "../data:model", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("more_settings") { |
| deps = [ |
| "..:metrics", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_expand_button:cr_expand_button.m", |
| "//ui/webui/resources/js:assert.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| |
| js_library("number_settings_section") { |
| deps = [ |
| ":input_behavior", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_input:cr_input.m", |
| ] |
| } |
| |
| js_library("settings_select") { |
| deps = [ |
| ":select_behavior", |
| ":settings_behavior", |
| "..:print_preview_utils", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:assert.m", |
| ] |
| } |
| |
| js_library("settings_behavior") { |
| deps = [ |
| "../data:model", |
| "//ui/webui/resources/js:assert.m", |
| ] |
| } |
| |
| js_library("input_behavior") { |
| deps = [ "//ui/webui/resources/js:assert.m" ] |
| } |
| |
| js_library("select_behavior") { |
| } |
| |
| js_library("link_container") { |
| deps = [ |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:cr.m", |
| ] |
| } |
| |
| js_library("preview_area") { |
| deps = [ |
| ":margin_control_container", |
| ":plugin_proxy", |
| ":settings_behavior", |
| "..:dark_mode_behavior", |
| "..:native_layer", |
| "..:print_preview_utils", |
| "../../pdf:pdf_scripting_api", |
| "../data:coordinate2d", |
| "../data:destination", |
| "../data:destination_match", |
| "../data:margins", |
| "../data:measurement_system", |
| "../data:model", |
| "../data:printable_area", |
| "../data:size", |
| "../data:state", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:cr.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| "//ui/webui/resources/js:util.m", |
| "//ui/webui/resources/js:web_ui_listener_behavior.m", |
| ] |
| } |
| |
| js_library("margin_control_container") { |
| deps = [ |
| ":margin_control", |
| ":settings_behavior", |
| "../data:coordinate2d", |
| "../data:margins", |
| "../data:measurement_system", |
| "../data:size", |
| "../data:state", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:event_tracker.m", |
| ] |
| externs_list = [ "$externs_path/pending.js" ] |
| } |
| |
| js_library("margin_control") { |
| deps = [ |
| ":input_behavior", |
| "../data:coordinate2d", |
| "../data:margins", |
| "../data:measurement_system", |
| "../data:size", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| |
| js_library("plugin_proxy") { |
| deps = [ |
| "../../pdf:pdf_scripting_api", |
| "//ui/webui/resources/js:assert.m", |
| ] |
| } |
| |
| js_library("invitation_promo") { |
| deps = [ |
| "..:metrics", |
| "../data:invitation", |
| "../data:invitation_store", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:event_tracker.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| ] |
| } |
| |
| if (is_chromeos_ash) { |
| js_library("destination_dialog_cros") { |
| deps = [ |
| ":destination_list", |
| ":invitation_promo", |
| ":print_preview_search_box", |
| ":provisional_destination_resolver", |
| "..:metrics", |
| "..:native_layer", |
| "../data:destination", |
| "../data:destination_store", |
| "../data:invitation_store", |
| "../data:print_server_store", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", |
| "//ui/webui/resources/cr_elements/cr_searchable_drop_down:cr_searchable_drop_down.m", |
| "//ui/webui/resources/js:event_tracker.m", |
| "//ui/webui/resources/js:list_property_update_behavior.m", |
| "//ui/webui/resources/js:web_ui_listener_behavior.m", |
| ] |
| } |
| } else { |
| js_library("destination_dialog") { |
| deps = [ |
| ":destination_list", |
| ":invitation_promo", |
| ":print_preview_search_box", |
| "..:metrics", |
| "..:native_layer", |
| "../data:destination", |
| "../data:destination_store", |
| "../data:invitation_store", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", |
| "//ui/webui/resources/js:event_tracker.m", |
| "//ui/webui/resources/js:list_property_update_behavior.m", |
| ] |
| } |
| } |
| |
| js_library("destination_list") { |
| deps = [ |
| ":destination_list_item", |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| "//ui/webui/resources/js:list_property_update_behavior.m", |
| ] |
| } |
| |
| js_library("destination_list_item") { |
| deps = [ |
| ":highlight_utils", |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/js:load_time_data.m", |
| "//ui/webui/resources/js:search_highlight_utils.m", |
| ] |
| } |
| |
| js_library("advanced_settings_dialog") { |
| deps = [ |
| ":advanced_settings_item", |
| ":print_preview_search_box", |
| ":settings_behavior", |
| "..:metrics", |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| "//ui/webui/resources/js:search_highlight_utils.m", |
| ] |
| } |
| |
| js_library("advanced_settings_item") { |
| deps = [ |
| ":highlight_utils", |
| ":settings_behavior", |
| "..:print_preview_utils", |
| "../data:cdd", |
| "../data:destination", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| ] |
| } |
| |
| js_library("print_preview_search_box") { |
| deps = [ |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_input:cr_input.m", |
| "//ui/webui/resources/cr_elements/cr_search_field:cr_search_field_behavior", |
| ] |
| } |
| |
| if (is_chromeos_ash) { |
| js_library("provisional_destination_resolver") { |
| deps = [ |
| "../data:destination", |
| "../data:destination_store", |
| "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", |
| "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", |
| "//ui/webui/resources/js:assert.m", |
| "//ui/webui/resources/js:i18n_behavior.m", |
| "//ui/webui/resources/js:promise_resolver.m", |
| ] |
| } |
| } |
| |
| js_library("highlight_utils") { |
| deps = [ |
| "//ui/webui/resources/js:assert.m", |
| "//ui/webui/resources/js:search_highlight_utils.m", |
| ] |
| } |
| |
| html_to_js("web_components") { |
| js_files = [ |
| "advanced_options_settings.js", |
| "advanced_settings_dialog.js", |
| "advanced_settings_item.js", |
| "app.js", |
| "button_strip.js", |
| "color_settings.js", |
| "copies_settings.js", |
| "destination_dialog_css.js", |
| "destination_list_item.js", |
| "destination_list.js", |
| "destination_select_css.js", |
| "destination_settings.js", |
| "dpi_settings.js", |
| "duplex_settings.js", |
| "header.js", |
| "icons.js", |
| "invitation_promo.js", |
| "layout_settings.js", |
| "link_container.js", |
| "margin_control_container.js", |
| "margin_control.js", |
| "margins_settings.js", |
| "media_size_settings.js", |
| "more_settings.js", |
| "number_settings_section.js", |
| "other_options_settings.js", |
| "pages_per_sheet_settings.js", |
| "pages_settings.js", |
| "preview_area.js", |
| "print_preview_search_box.js", |
| "print_preview_shared_css.js", |
| "print_preview_vars_css.js", |
| "scaling_settings.js", |
| "settings_section.js", |
| "settings_select.js", |
| "sidebar.js", |
| "throbber_css.js", |
| ] |
| if (is_chromeos_ash) { |
| js_files += [ |
| "destination_dialog_cros.js", |
| "destination_dropdown_cros.js", |
| "destination_select_cros.js", |
| "pin_settings.js", |
| "provisional_destination_resolver.js", |
| ] |
| } else { |
| js_files += [ |
| "destination_dialog.js", |
| "destination_select.js", |
| ] |
| } |
| } |