Commit 6cf41964 authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

WebUI: Share namespace rewrites across polymer/js_modulizer tools.

This is to avoid specifying the same rewrites over and over again,
during the Polymer 3 migration.

Bug: 1026426
Change-Id: If866cd3e8c5be2d3a2344a20ead7cdaaae3a43ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040431
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738754}
parent 24139de9
...@@ -329,7 +329,6 @@ js_modulizer("modulize_local") { ...@@ -329,7 +329,6 @@ js_modulizer("modulize_local") {
"test_util.js", "test_util.js",
] ]
namespace_rewrites = [ namespace_rewrites = [
"cr.ui.FocusRowBehavior|FocusRowBehavior",
"cr.ui.Store|Store", "cr.ui.Store|Store",
"MockInteractions.down|down", "MockInteractions.down|down",
"MockInteractions.pressAndReleaseKeyOn|pressAndReleaseKeyOn", "MockInteractions.pressAndReleaseKeyOn|pressAndReleaseKeyOn",
......
...@@ -11,7 +11,6 @@ js_modulizer("modulize") { ...@@ -11,7 +11,6 @@ js_modulizer("modulize") {
] ]
namespace_rewrites = [ namespace_rewrites = [
"certificate_manager.CertificatesBrowserProxyImpl|CertificatesBrowserProxyImpl", "certificate_manager.CertificatesBrowserProxyImpl|CertificatesBrowserProxyImpl",
"cr.isChromeOS|isChromeOS",
"test_util.eventToPromise|eventToPromise", "test_util.eventToPromise|eventToPromise",
"MockInteractions.keyEventOn|keyEventOn", "MockInteractions.keyEventOn|keyEventOn",
] ]
......
...@@ -38,8 +38,6 @@ js_modulizer("modulize") { ...@@ -38,8 +38,6 @@ js_modulizer("modulize") {
"iron_list_focus_test.js", "iron_list_focus_test.js",
] ]
namespace_rewrites = [ namespace_rewrites = [
"cr.isMac|isMac",
"cr.isWindows|isWindows",
"cr.toastManager.getToastManager|getToastManager", "cr.toastManager.getToastManager|getToastManager",
"MockInteractions.blur|blur", "MockInteractions.blur|blur",
"MockInteractions.downAndUp|downAndUp", "MockInteractions.downAndUp|downAndUp",
...@@ -49,7 +47,6 @@ js_modulizer("modulize") { ...@@ -49,7 +47,6 @@ js_modulizer("modulize") {
"MockInteractions.pressAndReleaseKeyOn|pressAndReleaseKeyOn", "MockInteractions.pressAndReleaseKeyOn|pressAndReleaseKeyOn",
"MockInteractions.tap|tap", "MockInteractions.tap|tap",
"Polymer.Base|Base", "Polymer.Base|Base",
"Polymer.dom.flush|flush",
"test_util.eventToPromise|eventToPromise", "test_util.eventToPromise|eventToPromise",
"test_util.flushTasks|flushTasks", "test_util.flushTasks|flushTasks",
"test_util.isChildVisible|isChildVisible", "test_util.isChildVisible|isChildVisible",
......
...@@ -2,17 +2,7 @@ ...@@ -2,17 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
common_namespace_rewrites_polymer = [ import("//ui/webui/resources/tools/js_modulizer.gni")
"cr.icon.getFavicon|getFavicon",
"cr.ui.FocusOutlineManager|FocusOutlineManager",
"cr.ui.FocusRowBehavior|FocusRowBehavior",
"cr.ui.focusWithoutInk|focusWithoutInk",
"Polymer.IronA11yAnnouncer|IronA11yAnnouncer",
"Polymer.PaperRippleBehavior|PaperRippleBehavior",
"Polymer.RenderStatus.afterNextRender|afterNextRender",
# TODO(dpapad): Add more such rewrites as they get discovered.
]
common_auto_imports = [ common_auto_imports = [
"third_party/polymer/v1_0/components-chromium/iron-a11y-announcer/iron-a11y-announcer.html|IronA11yAnnouncer", "third_party/polymer/v1_0/components-chromium/iron-a11y-announcer/iron-a11y-announcer.html|IronA11yAnnouncer",
...@@ -59,7 +49,7 @@ template("polymer_modulizer") { ...@@ -59,7 +49,7 @@ template("polymer_modulizer") {
rebase_path(target_gen_dir, root_build_dir), rebase_path(target_gen_dir, root_build_dir),
] ]
args += [ "--namespace_rewrites" ] + common_namespace_rewrites_polymer args += [ "--namespace_rewrites" ] + common_namespace_rewrites
if (defined(invoker.namespace_rewrites)) { if (defined(invoker.namespace_rewrites)) {
args += invoker.namespace_rewrites args += invoker.namespace_rewrites
} }
......
...@@ -24,10 +24,7 @@ polymer_modulizer("cr_action_menu") { ...@@ -24,10 +24,7 @@ polymer_modulizer("cr_action_menu") {
html_file = "cr_action_menu.html" html_file = "cr_action_menu.html"
html_type = "dom-module" html_type = "dom-module"
namespace_rewrites = [ namespace_rewrites = [
"cr.ui.focusWithoutInk|focusWithoutInk",
"cr.ui.FocusRow|FocusRow", "cr.ui.FocusRow|FocusRow",
"cr.isMac|isMac",
"cr.isWindows|isWindows",
"Polymer.dom|dom", "Polymer.dom|dom",
] ]
auto_imports = [ auto_imports = [
......
...@@ -40,8 +40,6 @@ polymer_modulizer("cr_toolbar") { ...@@ -40,8 +40,6 @@ polymer_modulizer("cr_toolbar") {
html_type = "dom-module" html_type = "dom-module"
auto_imports = auto_imports =
[ "ui/webui/resources/html/polymer.html|afterNextRender,html,Polymer" ] [ "ui/webui/resources/html/polymer.html|afterNextRender,html,Polymer" ]
namespace_rewrites =
[ "Polymer.RenderStatus.afterNextRender|afterNextRender" ]
} }
polymer_modulizer("cr_toolbar_search_field") { polymer_modulizer("cr_toolbar_search_field") {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# TODO(dpapad): Share these with polymer_modulizer.gni.
common_namespace_rewrites = [ common_namespace_rewrites = [
"cr.addSingletonGetter|addSingletonGetter", "cr.addSingletonGetter|addSingletonGetter",
"cr.addWebUIListener|addWebUIListener", "cr.addWebUIListener|addWebUIListener",
"cr.dispatchSimpleEvent|dispatchSimpleEvent", "cr.dispatchSimpleEvent|dispatchSimpleEvent",
"cr.icon.getFavicon|getFavicon",
"cr.isAndroid|isAndroid", "cr.isAndroid|isAndroid",
"cr.isChromeOS|isChromeOS", "cr.isChromeOS|isChromeOS",
"cr.isIOS|isIOS", "cr.isIOS|isIOS",
...@@ -16,10 +16,15 @@ common_namespace_rewrites = [ ...@@ -16,10 +16,15 @@ common_namespace_rewrites = [
"cr.removeWebUIListener|removeWebUIListener", "cr.removeWebUIListener|removeWebUIListener",
"cr.sendWithPromise|sendWithPromise", "cr.sendWithPromise|sendWithPromise",
"cr.ui.FocusOutlineManager|FocusOutlineManager", "cr.ui.FocusOutlineManager|FocusOutlineManager",
"cr.ui.FocusRowBehavior|FocusRowBehavior",
"cr.ui.focusWithoutInk|focusWithoutInk", "cr.ui.focusWithoutInk|focusWithoutInk",
"Polymer.dom.flush|flush", "Polymer.dom.flush|flush",
"Polymer.IronA11yAnnouncer|IronA11yAnnouncer",
"Polymer.PaperRippleBehavior|PaperRippleBehavior",
"Polymer.RenderStatus.afterNextRender|afterNextRender", "Polymer.RenderStatus.afterNextRender|afterNextRender",
"Polymer.RenderStatus.beforeNextRender|beforeNextRender", "Polymer.RenderStatus.beforeNextRender|beforeNextRender",
# TODO(dpapad): Add more such rewrites as they get discovered.
] ]
template("js_modulizer") { template("js_modulizer") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment