[Reland] WebUI: Exclude unnecessary build tasks from Android and iOS builds.
Added assertions to make sure that cr_elements/BUILD.gn and
cr_components/BUILD.gn are not loaded at all in Android/iOS builds.
These folders hold Polymer elements, which are not relevant for
Android/iOS since Polymer is not used (and not shipped) on those
platforms.
Those assertions revealed a bunch of places were unnecessary work was
triggered on Android/iOS builds, and had to be fixed.
These were originally discovered as part of migrating various shared
WebUI elements to TypeScript (through bot failures).
Bug: 1189595
Change-Id: I3a3065228056b23a9421e26bdab0c1e970514939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3544200
Reviewed-by: Robert Sesek <[email protected]>
Auto-Submit: Demetrios Papadopoulos <[email protected]>
Reviewed-by: Rebekah Potter <[email protected]>
Commit-Queue: Demetrios Papadopoulos <[email protected]>
Cr-Commit-Position: refs/heads/main@{#985869}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index ddd365d3..c2349c4 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1984,8 +1984,6 @@
"//chrome/browser/ui/webui/downloads:mojo_bindings",
"//chrome/browser/ui/webui/history_clusters:mojo_bindings",
"//chrome/browser/ui/webui/internals/user_education:mojo_bindings",
- "//chrome/browser/ui/webui/new_tab_page:mojo_bindings",
- "//chrome/browser/ui/webui/new_tab_page_third_party:mojo_bindings",
"//chrome/browser/ui/webui/omnibox:mojo_bindings",
"//chrome/browser/ui/webui/read_later:mojo_bindings",
"//chrome/browser/ui/webui/read_later/side_panel:mojo_bindings",
@@ -2410,10 +2408,6 @@
"//ui/surface",
"//ui/web_dialogs",
"//ui/webui",
- "//ui/webui/resources/cr_components/color_change_listener:mojom",
- "//ui/webui/resources/cr_components/customize_themes:mojom",
- "//ui/webui/resources/cr_components/most_visited:mojom",
- "//ui/webui/resources/js/browser_command:mojo_bindings",
]
if (is_chromeos_ash) {
sources += [
@@ -4439,6 +4433,8 @@
"//chrome/browser/ui/color:color_headers",
"//chrome/browser/ui/webui/access_code_cast:mojo_bindings",
"//chrome/browser/ui/webui/image_editor:mojo_bindings",
+ "//chrome/browser/ui/webui/new_tab_page:mojo_bindings",
+ "//chrome/browser/ui/webui/new_tab_page_third_party:mojo_bindings",
"//chrome/browser/ui/webui/tab_strip:mojo_bindings",
"//chrome/browser/web_applications",
"//chrome/browser/web_applications/adjustments",