Commit f30e2eb5 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Audio Player: JS modules for repeat-button Polymer element

Add the HTML import for IronButtonState and IronControlState because
these become the JS import after the conversion.  These are used by the
`auto_imports` in the BUILD.gn.

Move the <link> tag inside the <template> because this is enforced by
polymer_modulizer() this requires changing from rel="import" to normal
rel="stylesheet" which in turn requires to changed the URL to request
the CSS.

Remove build target "closure_compile_externs" because it had empty
sources and externs_list, thus not checking anything.

Bug: 1133186
Change-Id: I96b7e475b7099465186f94615f2564c2548adddb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520480Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825254}
parent 3a6383c1
...@@ -3,11 +3,18 @@ ...@@ -3,11 +3,18 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//tools/polymer/polymer.gni")
js_type_check("closure_compile") { group("closure_compile") {
deps = [
":closure_compile_internal",
":closure_compile_jsmodules",
]
}
js_type_check("closure_compile_internal") {
deps = [ deps = [
":audio_player", ":audio_player",
":closure_compile_externs",
":control_panel", ":control_panel",
":repeat_button", ":repeat_button",
":track_info_panel", ":track_info_panel",
...@@ -15,11 +22,6 @@ js_type_check("closure_compile") { ...@@ -15,11 +22,6 @@ js_type_check("closure_compile") {
] ]
} }
js_library("closure_compile_externs") {
sources = []
externs_list = []
}
js_library("audio_player") { js_library("audio_player") {
deps = [ deps = [
":control_panel", ":control_panel",
...@@ -48,3 +50,37 @@ js_library("track_info_panel") { ...@@ -48,3 +50,37 @@ js_library("track_info_panel") {
js_library("track_list") { js_library("track_list") {
} }
polymer_modulizer("repeat_button") {
js_file = "repeat_button.js"
html_file = "repeat_button.html"
html_type = "dom-module"
preserve_url_scheme = true
namespace_rewrites = [
"Polymer.IronButtonState|IronButtonState",
"Polymer.IronControlState|IronControlState",
]
auto_imports = [
"third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state.html|IronButtonState",
"third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state.html|IronControlState",
]
}
js_library("repeat_button.m") {
sources = [
"$root_gen_dir/ui/file_manager/audio_player/elements/repeat_button.m.js",
]
deps = [
"//third_party/polymer/v3_0/components-chromium/iron-behaviors:iron-button-state",
"//third_party/polymer/v3_0/components-chromium/iron-behaviors:iron-control-state",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
extra_deps = [ ":repeat_button_module" ]
}
js_type_check("closure_compile_jsmodules") {
is_polymer3 = true
deps = [ ":repeat_button.m" ]
}
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
--> -->
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-behaviors/iron-button-state.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-behaviors/iron-control-state.html">
<link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_toggle_ripple.html"> <link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_toggle_ripple.html">
<dom-module id="repeat-button"> <dom-module id="repeat-button">
<link rel="import" type="css" href="repeat_button.css">
<template> <template>
<link rel="stylesheet" href="elements/repeat_button.css">
<files-toggle-ripple activated="[[isActive(repeatMode)]]" class$="{{repeatMode}}"></files-toggle-ripple> <files-toggle-ripple activated="[[isActive(repeatMode)]]" class$="{{repeatMode}}"></files-toggle-ripple>
</template> </template>
<script src="repeat_button.js"></script> <script src="repeat_button.js"></script>
</dom-module> </dom-module>
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