Commit 50f457b5 authored by Trent Begin's avatar Trent Begin Committed by Commit Bot

Make network diagnostics mojo include compatible with polymer 3

The network diagnostics mojo is now a separate html file instead of
being included directly. This allows the polymer 3 modulizes to
correctly convert the include into a module.

Bug: chromium:11406598
Change-Id: Idc4dc7c1a23b0a9897742289c311c07e0507fc91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490349
Commit-Queue: Trent Begin <tbegin@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822253}
parent 5211769c
...@@ -96,6 +96,8 @@ preprocess_grit("preprocess_generated") { ...@@ -96,6 +96,8 @@ preprocess_grit("preprocess_generated") {
"chromeos/cellular_setup/sim_detect_page.m.js", "chromeos/cellular_setup/sim_detect_page.m.js",
"chromeos/cellular_setup/subflow_behavior.m.js", "chromeos/cellular_setup/subflow_behavior.m.js",
"chromeos/cellular_setup/webview_post_util.m.js", "chromeos/cellular_setup/webview_post_util.m.js",
"chromeos/network_health/network_diagnostics.m.js",
"chromeos/network_health/network_diagnostics_mojo.m.js",
"chromeos/network/cr_policy_network_behavior_mojo.m.js", "chromeos/network/cr_policy_network_behavior_mojo.m.js",
"chromeos/network/cr_policy_network_indicator_mojo.m.js", "chromeos/network/cr_policy_network_indicator_mojo.m.js",
"chromeos/network/mojo_interface_provider.m.js", "chromeos/network/mojo_interface_provider.m.js",
...@@ -238,6 +240,8 @@ preprocess_grit("preprocess_polymer2") { ...@@ -238,6 +240,8 @@ preprocess_grit("preprocess_polymer2") {
"chromeos/network/cr_policy_network_indicator_mojo.js", "chromeos/network/cr_policy_network_indicator_mojo.js",
"chromeos/network_health/network_diagnostics.html", "chromeos/network_health/network_diagnostics.html",
"chromeos/network_health/network_diagnostics.js", "chromeos/network_health/network_diagnostics.js",
"chromeos/network_health/network_diagnostics_mojo.html",
"chromeos/network_health/network_diagnostics_mojo.js",
"chromeos/network_health/network_health_summary.html", "chromeos/network_health/network_health_summary.html",
"chromeos/network_health/network_health_summary.js", "chromeos/network_health/network_health_summary.js",
"chromeos/network/mojo_interface_provider.html", "chromeos/network/mojo_interface_provider.html",
......
...@@ -21,6 +21,7 @@ js_type_check("closure_compile_module") { ...@@ -21,6 +21,7 @@ js_type_check("closure_compile_module") {
is_polymer3 = true is_polymer3 = true
deps = [ deps = [
":network_diagnostics.m", ":network_diagnostics.m",
":network_diagnostics_mojo.m",
":network_health_summary.m", ":network_health_summary.m",
] ]
} }
...@@ -42,6 +43,13 @@ js_library("network_diagnostics") { ...@@ -42,6 +43,13 @@ js_library("network_diagnostics") {
] ]
} }
js_library("network_diagnostics_mojo") {
deps = [
"//chromeos/services/network_health/public/mojom:mojom_js_library_for_compile",
"//ui/webui/resources/js:cr",
]
}
js_library("network_health_summary.m") { js_library("network_health_summary.m") {
sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.m.js" ] sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.m.js" ]
deps = [ deps = [
...@@ -56,6 +64,7 @@ js_library("network_health_summary.m") { ...@@ -56,6 +64,7 @@ js_library("network_health_summary.m") {
js_library("network_diagnostics.m") { js_library("network_diagnostics.m") {
sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network_health/network_diagnostics.m.js" ] sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network_health/network_diagnostics.m.js" ]
deps = [ deps = [
":network_diagnostics_mojo.m",
"//chromeos/services/network_health/public/mojom:mojom_js_library_for_compile", "//chromeos/services/network_health/public/mojom:mojom_js_library_for_compile",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:i18n_behavior.m", "//ui/webui/resources/js:i18n_behavior.m",
...@@ -63,6 +72,12 @@ js_library("network_diagnostics.m") { ...@@ -63,6 +72,12 @@ js_library("network_diagnostics.m") {
extra_deps = [ ":network_diagnostics_module" ] extra_deps = [ ":network_diagnostics_module" ]
} }
js_library("network_diagnostics_mojo.m") {
sources = [ "$root_gen_dir/ui/webui/resources/cr_components/chromeos/network_health/network_diagnostics_mojo.m.js" ]
deps = [ "//chrome/browser/ui/webui/settings/chromeos/search:mojo_bindings_js_library_for_compile" ]
extra_deps = [ ":modulize" ]
}
# polymer_modulizer for converting Polymer2 to Polymer3 # polymer_modulizer for converting Polymer2 to Polymer3
polymer_modulizer("network_health_summary") { polymer_modulizer("network_health_summary") {
...@@ -77,8 +92,13 @@ polymer_modulizer("network_diagnostics") { ...@@ -77,8 +92,13 @@ polymer_modulizer("network_diagnostics") {
html_type = "dom-module" html_type = "dom-module"
} }
js_modulizer("modulize") {
input_files = [ "network_diagnostics_mojo.js" ]
}
group("polymer3_elements") { group("polymer3_elements") {
public_deps = [ public_deps = [
":modulize",
":network_diagnostics_module", ":network_diagnostics_module",
":network_health_summary_module", ":network_health_summary_module",
] ]
......
<link rel="import" href="../../../html/polymer.html"> <link rel="import" href="../../../html/polymer.html">
<link rel="import" href="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/network_health/network_diagnostics_mojo.html">
<link rel="import" href="chrome://resources/mojo/chromeos/services/network_health/public/mojom/network_diagnostics.mojom.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../../../cr_elements/cr_button/cr_button.html"> <link rel="import" href="../../../cr_elements/cr_button/cr_button.html">
<link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="../../../html/i18n_behavior.html">
......
<link rel="import" href="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.html">
<script src="chrome://resources/mojo/chromeos/services/network_health/public/mojom/network_diagnostics.mojom-lite.js"></script>
<script src="network_diagnostics_mojo.js"></script>
// Copyright 2020 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.
// clang-format off
// #import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
// #import 'chrome://resources/mojo/chromeos/services/network_health/public/mojom/network_diagnostics.mojom-lite.js';
// clang-format on
/**
* @fileoverview Wrapper around Network Diagnostics mojom file and associated
* utilities.
* TODO(crbug/1111852): Remove this wrapper once Polymer2 no longer needs to be
* supported. These imports can be used directly.
*/
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