Skip to content

Commit

Permalink
OOBE - Polymer3 migration - assistant_value_prop
Browse files Browse the repository at this point in the history
Migrate assistant_value_prop to ES6 syntax and add directives
to generate its modularised version.

Bug: 1184731
Change-Id: Ifb369fce24abd325eadc97aafff52f895e26637f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3571758
Reviewed-by: Roman Aleksandrov <raleksandrov@google.com>
Commit-Queue: Renato Silva <rrsilva@google.com>
Cr-Commit-Position: refs/heads/main@{#989863}
  • Loading branch information
Renato Silva authored and Chromium LUCI CQ committed Apr 7, 2022
1 parent 68a3f29 commit ed6f9a7
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 162 deletions.
29 changes: 25 additions & 4 deletions chrome/browser/resources/chromeos/assistant_optin/BUILD.gn
Expand Up @@ -6,9 +6,9 @@ import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/preprocess_if_expr.gni")
import("//tools/polymer/polymer.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
import("//tools/polymer/polymer.gni")
import("./modulization_utils.gni")

assert(is_chromeos_ash, "Only available in ash Chrome.")
Expand Down Expand Up @@ -87,6 +87,7 @@ preprocess_if_expr("preprocess") {
"icon.html",
"setting_zippy.html",
"setting_zippy.js",
"utils.html",
"utils.js",
"voice_match_entry.html",
"voice_match_entry.js",
Expand All @@ -100,6 +101,7 @@ preprocess_if_expr("preprocess_generated") {
out_folder = "$target_gen_dir/$preprocessed_folder"
out_manifest = "$target_gen_dir/$autogenerated_files_manifest"
in_files = [
"assistant_value_prop.m.js",
"assistant_voice_match.m.js",
"browser_proxy.m.js",
"voice_match_entry.m.js",
Expand All @@ -115,11 +117,21 @@ js_type_check("closure_compile") {
is_polymer3 = true
closure_flags = default_closure_args
deps = [
#"assistant_value_prop.m",
#":assistant_voice_match.m",
":voice_match_entry.m",
]
}

js_library("assistant_value_prop.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.m.js" ]
deps = [
"../login/components/behaviors:oobe_i18n_behavior.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
extra_deps = [ ":assistant_value_prop_module" ]
}

js_library("voice_match_entry.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/assistant_optin/voice_match_entry.m.js" ]
deps = [
Expand All @@ -132,8 +144,8 @@ js_library("voice_match_entry.m") {
js_library("assistant_voice_match.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.m.js" ]
deps = [
"../login/components/behaviors:oobe_i18n_behavior.m",
"../login/components/behaviors:multi_step_behavior.m",
"../login/components/behaviors:oobe_i18n_behavior.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:load_time_data.m",
"//ui/webui/resources/js:util.m",
Expand All @@ -147,13 +159,22 @@ js_library("assistant_voice_match.m") {

group("polymer3_elements") {
public_deps = [
":assistant_value_prop_module",
":assistant_voice_match_module",
":voice_match_entry_module",
":modulize",
":setting_zippy_module",
":modulize"
":voice_match_entry_module",
]
}

polymer_modulizer("assistant_value_prop") {
js_file = "assistant_value_prop.js"
html_file = "assistant_value_prop.html"
html_type = "dom-module"
auto_imports = assistant_auto_imports
namespace_rewrites = assistant_namespace_rewrites
}

polymer_modulizer("assistant_voice_match") {
js_file = "assistant_voice_match.js"
html_file = "assistant_voice_match.html"
Expand Down
Expand Up @@ -5,7 +5,6 @@
<include src="assistant_common_styles.html">
<include src="assistant_loading.html">
<include src="assistant_related_info.html">
<include src="assistant_value_prop.html">
<include src="icon.html">

<link rel="import" href="/components/common_styles/common_styles.html">
Expand All @@ -14,6 +13,7 @@
<link rel="import" href="/components/behaviors/oobe_i18n_behavior.html">

<link rel="import" href="/assistant_optin/assistant_voice_match.html">
<link rel="import" href="/assistant_optin/assistant_value_prop.html">
<link rel="import" href="/assistant_optin/setting_zippy.html">

<dom-module id="assistant-optin-flow-element">
Expand Down
Expand Up @@ -5,7 +5,6 @@
// <include src="utils.js">
// <include src="assistant_loading.js">
// <include src="assistant_related_info.js">
// <include src="assistant_value_prop.js">

/**
* @fileoverview Polymer element for displaying material design assistant
Expand Down
Expand Up @@ -7,12 +7,16 @@
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">

<link rel="import" href="/components/dialogs/oobe_adaptive_dialog.html">
<link rel="import" href="/components/behaviors/oobe_dialog_host_behavior.html">
<link rel="import" href="/components/behaviors/oobe_i18n_behavior.html">
<link rel="import" href="/components/buttons/oobe_next_button.html">
<link rel="import" href="/components/buttons/oobe_text_button.html">
<link rel="import" href="/components/common_styles/oobe_dialog_host_styles.html">
<link rel="import" href="../components/dialogs/oobe_adaptive_dialog.html">
<link rel="import" href="../components/behaviors/oobe_dialog_host_behavior.html">
<link rel="import" href="../components/behaviors/oobe_i18n_behavior.html">
<link rel="import" href="../components/buttons/oobe_next_button.html">
<link rel="import" href="../components/buttons/oobe_text_button.html">
<link rel="import" href="../components/common_styles/oobe_dialog_host_styles.html">

<link rel="import" href="./browser_proxy.html">
<link rel="import" href="./setting_zippy.html">
<link rel="import" href="./utils.html">

<dom-module id="assistant-value-prop">
<template>
Expand Down Expand Up @@ -105,4 +109,5 @@ <h1 slot="title" id="title-text"></h1>
</div>
</cr-dialog>
</template>
<script src="assistant_value_prop.js"></script>
</dom-module>

0 comments on commit ed6f9a7

Please sign in to comment.