| # Copyright 2022 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("//ui/webui/resources/include_polymer.gni") |
| |
| # TS files holding a non-Polymer element definition and have an equivalent .html |
| # file. |
| web_component_files_native_ts = [ |
| "cr_tab_box/cr_tab_box.ts", |
| "cr_tree/cr_tree.ts", |
| "cr_tree/cr_tree_item.ts", |
| ] |
| |
| # Files that are passed as input to html_to_wrapper(). |
| native_html_files = [] |
| foreach(f, web_component_files_native_ts) { |
| native_html_files += [ string_replace(f, ".ts", ".html") ] |
| } |
| |
| # Files that are generated by html_to_wrapper(). |
| native_html_wrapper_files = [] |
| foreach(f, native_html_files) { |
| native_html_wrapper_files += [ f + ".ts" ] |
| } |
| |
| if (include_polymer) { |
| # TS files holding a Polymer element definition and have an equivalent .html |
| # file. |
| web_component_files_polymer_ts = [ |
| "cr_a11y_announcer/cr_a11y_announcer.ts", |
| "cr_action_menu/cr_action_menu.ts", |
| "cr_drawer/cr_drawer.ts", |
| "cr_expand_button/cr_expand_button.ts", |
| "cr_fingerprint/cr_fingerprint_progress_arc.ts", |
| "cr_grid/cr_grid.ts", |
| "cr_link_row/cr_link_row.ts", |
| "cr_profile_avatar_selector/cr_profile_avatar_selector_grid.ts", |
| "cr_profile_avatar_selector/cr_profile_avatar_selector.ts", |
| "cr_radio_group/cr_radio_group.ts", |
| "cr_search_field/cr_search_field.ts", |
| "cr_slider/cr_slider.ts", |
| "cr_tabs/cr_tabs.ts", |
| "cr_toast/cr_toast_manager.ts", |
| "cr_toast/cr_toast.ts", |
| "cr_toolbar/cr_toolbar.ts", |
| "cr_toolbar/cr_toolbar_search_field.ts", |
| "cr_toolbar/cr_toolbar_selection_overlay.ts", |
| "cr_view_manager/cr_view_manager.ts", |
| ] |
| |
| if (is_chromeos) { |
| web_component_files_polymer_ts += |
| [ "cr_searchable_drop_down/cr_searchable_drop_down.ts" ] |
| } |
| |
| icons_html_files = [ |
| "mwb_shared_icons.html", |
| "cr_fingerprint/cr_fingerprint_icon.html", |
| ] |
| |
| # Polymer HTML files that are passed as input to html_to_wrapper(). |
| polymer_html_files = [] |
| foreach(f, web_component_files_polymer_ts) { |
| polymer_html_files += [ string_replace(f, ".ts", ".html") ] |
| } |
| |
| # Files that are generated by html_to_wrapper(). |
| polymer_html_wrapper_files = [] |
| foreach(f, polymer_html_files + icons_html_files) { |
| polymer_html_wrapper_files += [ f + ".ts" ] |
| } |
| } |
| |
| # Files that either dont hold a custom element definition or the custom element |
| # does not have an equivalent .html file. |
| non_web_component_files_ts = [ |
| "cr_lazy_render/cr_lazy_render.ts", |
| "cr_splitter/cr_splitter.ts", |
| "cr_tree/cr_tree_base.ts", |
| ] |
| |
| if (include_polymer) { |
| non_web_component_files_ts += [ |
| "cr_auto_img/cr_auto_img.ts", |
| "cr_container_shadow_mixin.ts", |
| "cr_menu_selector/cr_menu_selector.ts", |
| "cr_search_field/cr_search_field_mixin.ts", |
| "find_shortcut_mixin.ts", |
| "mouse_hoverable_mixin.ts", |
| ] |
| |
| # Files that are passed as input to css_to_wrapper(). |
| css_files = [ |
| "cr_nav_menu_item_style.css", |
| "cr_page_host_style.css", |
| "mwb_element_shared_style.css", |
| "mwb_shared_style.css", |
| "mwb_shared_vars.css", |
| "search_highlight_style.css", |
| ] |
| |
| # Files that are generated by css_to_wrapper(). |
| css_wrapper_files = [] |
| foreach(f, css_files) { |
| css_wrapper_files += [ f + ".ts" ] |
| } |
| } |
| |
| # List of all files above with the "cr_elements/" prefix to be used in a parent |
| # BUILD.gn file. |
| cr_elements_files = [] |
| foreach(f, |
| web_component_files_native_ts + native_html_wrapper_files + |
| non_web_component_files_ts) { |
| cr_elements_files += [ "cr_elements/" + f ] |
| } |
| |
| if (include_polymer) { |
| foreach(f, |
| web_component_files_polymer_ts + polymer_html_wrapper_files + |
| css_wrapper_files) { |
| cr_elements_files += [ "cr_elements/" + f ] |
| } |
| } |