Commit c7846265 authored by dpapad's avatar dpapad Committed by Commit Bot

Port chrome://device-emulator to Polymer3.

Fixed: 1015241
Test: Page still loads, no more HTML Imports warnings in DevTools.
Change-Id: Id253682734ef7d456b5dd244657011f5de03d73d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874814Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708691}
parent 199d1975
...@@ -5360,6 +5360,7 @@ grit("resources") { ...@@ -5360,6 +5360,7 @@ grit("resources") {
if (is_chromeos) { if (is_chromeos) {
deps += [ deps += [
"//chrome/browser/resources/chromeos/crostini_installer:polymer3_elements", "//chrome/browser/resources/chromeos/crostini_installer:polymer3_elements",
"//chrome/browser/resources/chromeos/emulator:polymer3_elements",
"//chrome/browser/resources/chromeos/set_time_dialog:polymer3_elements", "//chrome/browser/resources/chromeos/set_time_dialog:polymer3_elements",
"//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings_js",
"//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings_js",
......
...@@ -504,18 +504,14 @@ ...@@ -504,18 +504,14 @@
<include name="IDR_ABOUT_POWER_JS" file="resources\chromeos\power.js" compress="gzip" type="BINDATA" /> <include name="IDR_ABOUT_POWER_JS" file="resources\chromeos\power.js" compress="gzip" type="BINDATA" />
<include name="IDR_ABOUT_POWER_CSS" file="resources\chromeos\power.css" compress="gzip" type="BINDATA" /> <include name="IDR_ABOUT_POWER_CSS" file="resources\chromeos\power.css" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_HTML" file="resources\chromeos\emulator\device_emulator.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_HTML" file="resources\chromeos\emulator\device_emulator.html" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_HTML" file="resources\chromeos\emulator\audio_settings.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_CSS" file="resources\chromeos\emulator\device_emulator.css" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_JS" file="resources\chromeos\emulator\audio_settings.js" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\audio_settings.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_HTML" file="resources\chromeos\emulator\battery_settings.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\battery_settings.js" use_base_dir="false" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_JS" file="resources\chromeos\emulator\battery_settings.js" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\bluetooth_settings.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_HTML" file="resources\chromeos\emulator\bluetooth_settings.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_ICONS_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\icons.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_JS" file="resources\chromeos\emulator\bluetooth_settings.js" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\input_device_settings.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_ICONS_HTML" file="resources\chromeos\emulator\icons.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_PAGES_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\device_emulator_pages.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_HTML" file="resources\chromeos\emulator\input_device_settings.html" compress="gzip" type="BINDATA" /> <include name="IDR_DEVICE_EMULATOR_SHARED_STYLES_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\emulator\shared_styles.js" use_base_dir="false" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_JS" file="resources\chromeos\emulator\input_device_settings.js" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_PAGES_HTML" file="resources\chromeos\emulator\device_emulator_pages.html" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_PAGES_JS" file="resources\chromeos\emulator\device_emulator_pages.js" compress="gzip" type="BINDATA" />
<include name="IDR_DEVICE_EMULATOR_SHARED_STYLES_HTML" file="resources\chromeos\emulator\shared_styles.html" compress="gzip" type="BINDATA" />
</if> </if>
<if expr="chromeos"> <if expr="chromeos">
<include name="IDR_SET_TIME_HTML" file="resources\chromeos\set_time_dialog\set_time.html" type="BINDATA" compress="gzip" /> <include name="IDR_SET_TIME_HTML" file="resources\chromeos\set_time_dialog\set_time.html" type="BINDATA" compress="gzip" />
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
# 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") { js_type_check("closure_compile") {
is_polymer3 = true
deps = [ deps = [
":audio_settings", ":audio_settings",
":battery_settings", ":battery_settings",
...@@ -16,32 +18,93 @@ js_type_check("closure_compile") { ...@@ -16,32 +18,93 @@ js_type_check("closure_compile") {
js_library("audio_settings") { js_library("audio_settings") {
deps = [ deps = [
"//ui/webui/resources/js:cr", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:cr.m",
] ]
externs_list = [ "$externs_path/chrome_send.js" ] externs_list = [ "$externs_path/chrome_send.js" ]
} }
js_library("bluetooth_settings") { js_library("bluetooth_settings") {
deps = [ deps = [
"//ui/webui/resources/js:web_ui_listener_behavior", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
externs_list = [ "$externs_path/chrome_send.js" ] externs_list = [ "$externs_path/chrome_send.js" ]
} }
js_library("battery_settings") { js_library("battery_settings") {
deps = [ deps = [
"//ui/webui/resources/js:web_ui_listener_behavior", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
externs_list = [ "$externs_path/chrome_send.js" ] externs_list = [ "$externs_path/chrome_send.js" ]
} }
js_library("input_device_settings") { js_library("input_device_settings") {
deps = [ deps = [
"//ui/webui/resources/js:web_ui_listener_behavior", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
externs_list = [ "$externs_path/chrome_send.js" ] externs_list = [ "$externs_path/chrome_send.js" ]
} }
js_library("device_emulator_pages") { js_library("device_emulator_pages") {
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
]
externs_list = [ "$externs_path/chrome_send.js" ] externs_list = [ "$externs_path/chrome_send.js" ]
} }
polymer_modulizer("audio_settings") {
js_file = "audio_settings.js"
html_file = "audio_settings.html"
html_type = "v3-ready"
}
polymer_modulizer("battery_settings") {
js_file = "battery_settings.js"
html_file = "battery_settings.html"
html_type = "v3-ready"
}
polymer_modulizer("bluetooth_settings") {
js_file = "bluetooth_settings.js"
html_file = "bluetooth_settings.html"
html_type = "v3-ready"
}
polymer_modulizer("input_device_settings") {
js_file = "input_device_settings.js"
html_file = "input_device_settings.html"
html_type = "v3-ready"
}
polymer_modulizer("device_emulator_pages") {
js_file = "device_emulator_pages.js"
html_file = "device_emulator_pages.html"
html_type = "v3-ready"
}
polymer_modulizer("icons") {
js_file = "icons.js"
html_file = "icons.html"
html_type = "v3-ready"
}
polymer_modulizer("shared_styles") {
js_file = "shared_styles.js"
html_file = "shared_styles.html"
html_type = "v3-ready"
}
group("polymer3_elements") {
deps = [
":audio_settings_module",
":battery_settings_module",
":bluetooth_settings_module",
":device_emulator_pages_module",
":icons_module",
":input_device_settings_module",
":shared_styles_module",
]
}
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_group/cr_radio_group.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="icons.html">
<link rel="import" href="shared_styles.html">
<dom-module id="audio-settings">
<template>
<style include="device-emulator-shared-styles cr-shared-style iron-flex <style include="device-emulator-shared-styles cr-shared-style iron-flex
iron-flex-alignment iron-positioning"> iron-flex-alignment iron-positioning">
</style> </style>
...@@ -103,6 +87,3 @@ ...@@ -103,6 +87,3 @@
<cr-button on-click="appendNewNode">Add Node</cr-button> <cr-button on-click="appendNewNode">Add Node</cr-button>
</div> </div>
</div> </div>
</template>
<script src="audio_settings.js"></script>
</dom-module>
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
// 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.
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.m.js';
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js';
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js';
import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.m.js';
import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.m.js';
import 'chrome://resources/cr_elements/shared_style_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import './icons.js';
import './shared_styles.js';
import {sendWithPromise} from 'chrome://resources/js/cr.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
/** @enum {string} */ var AudioNodeType = { /** @enum {string} */ var AudioNodeType = {
HEADPHONE: 'HEADPHONE', HEADPHONE: 'HEADPHONE',
MIC: 'MIC', MIC: 'MIC',
...@@ -50,6 +65,8 @@ var AudioNode = function() { ...@@ -50,6 +65,8 @@ var AudioNode = function() {
Polymer({ Polymer({
is: 'audio-settings', is: 'audio-settings',
_template: html`{__html_template__}`,
properties: { properties: {
/** /**
* An AudioNode which is currently being edited. * An AudioNode which is currently being edited.
...@@ -122,7 +139,7 @@ Polymer({ ...@@ -122,7 +139,7 @@ Polymer({
}, },
ready: function() { ready: function() {
cr.sendWithPromise('requestAudioNodes').then( sendWithPromise('requestAudioNodes').then(
this.updateAudioNodes_.bind(this)); this.updateAudioNodes_.bind(this));
}, },
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_group/cr_radio_group.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/cr_elements/md_select_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="icons.html">
<link rel="import" href="shared_styles.html">
<dom-module id="battery-settings">
<template>
<!-- TODO(michaelpg): Wrap the line below to fit within the 80-char limit.
See https://github.com/Polymer/polymer/pull/3668. -->
<style include="device-emulator-shared-styles iron-flex iron-flex-alignment <style include="device-emulator-shared-styles iron-flex iron-flex-alignment
iron-positioning md-select"> iron-positioning md-select">
cr-input { cr-input {
...@@ -89,6 +69,3 @@ ...@@ -89,6 +69,3 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</template>
<script src="battery_settings.js"></script>
</dom-module>
...@@ -2,9 +2,27 @@ ...@@ -2,9 +2,27 @@
// 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.
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.m.js';
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js';
import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.m.js';
import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.m.js';
import 'chrome://resources/cr_elements/shared_vars_css.m.js';
import 'chrome://resources/cr_elements/md_select_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import './icons.js';
import './shared_styles.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
Polymer({ Polymer({
is: 'battery-settings', is: 'battery-settings',
_template: html`{__html_template__}`,
behaviors: [WebUIListenerBehavior], behaviors: [WebUIListenerBehavior],
properties: { properties: {
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_group/cr_radio_group.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="icons.html">
<link rel="import" href="shared_styles.html">
<dom-module id="bluetooth-settings">
<template>
<style include="device-emulator-shared-styles cr-shared-style iron-flex <style include="device-emulator-shared-styles cr-shared-style iron-flex
iron-flex-alignment iron-positioning"> iron-flex-alignment iron-positioning">
</style> </style>
...@@ -173,6 +156,3 @@ ...@@ -173,6 +156,3 @@
</cr-button> </cr-button>
</div> </div>
</div> </div>
</template>
<script src="bluetooth_settings.js"></script>
</dom-module>
...@@ -2,6 +2,22 @@ ...@@ -2,6 +2,22 @@
// 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.
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.m.js';
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js';
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js';
import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.m.js';
import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.m.js';
import 'chrome://resources/cr_elements/shared_style_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import './icons.js';
import './shared_styles.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
/** /**
* A bluetooth device. * A bluetooth device.
* @constructor * @constructor
...@@ -54,6 +70,8 @@ var BluetoothDevice = function() { ...@@ -54,6 +70,8 @@ var BluetoothDevice = function() {
Polymer({ Polymer({
is: 'bluetooth-settings', is: 'bluetooth-settings',
_template: html`{__html_template__}`,
behaviors: [WebUIListenerBehavior], behaviors: [WebUIListenerBehavior],
properties: { properties: {
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
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. */
html,
body {
height: 100%;
width: 100%;
}
body { body {
font-family: 'Roboto', Arial, Verdana, Helvetica; font-family: 'Roboto', Arial, Verdana, Helvetica;
margin: 0;
} }
...@@ -2,29 +2,9 @@ ...@@ -2,29 +2,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Device Emulator</title> <title>Device Emulator</title>
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="device_emulator_pages.html">
<link rel="stylesheet" href="chrome://resources/css/roboto.css">
<link rel="stylesheet" href="device_emulator.css"> <link rel="stylesheet" href="device_emulator.css">
<custom-style>
<style include="iron-flex iron-flex-alignment">
html,
body {
height: 100%;
width: 100%;
}
body {
font-family: Roboto;
margin: 0;
}
</style>
</custom-style>
</head> </head>
<body unresolved class="fullbleed layout vertical"> <body>
<device-emulator-pages class="flex layout vertical"></device-emulator-pages> <device-emulator-pages></device-emulator-pages>
<script type="module" src="device_emulator_pages.js"></script>
</body> </body>
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_drawer/cr_drawer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-selector.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html">
<link rel="import" href="audio_settings.html">
<link rel="import" href="battery_settings.html">
<link rel="import" href="bluetooth_settings.html">
<link rel="import" href="icons.html">
<link rel="import" href="input_device_settings.html">
<link rel="import" href="shared_styles.html">
<dom-module id="device-emulator-pages">
<template>
<style include="device-emulator-shared-styles iron-flex iron-flex-alignment <style include="device-emulator-shared-styles iron-flex iron-flex-alignment
iron-positioning"> iron-positioning">
:host { :host {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%;
} }
iron-pages { iron-pages {
...@@ -105,6 +88,3 @@ ...@@ -105,6 +88,3 @@
<input-device-settings id="inputDeviceSettings"></input-device-settings> <input-device-settings id="inputDeviceSettings"></input-device-settings>
</iron-pages> </iron-pages>
</div> </div>
</template>
<script src="device_emulator_pages.js"></script>
</dom-module>
...@@ -2,9 +2,27 @@ ...@@ -2,9 +2,27 @@
// 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.
import 'chrome://resources/cr_elements/cr_drawer/cr_drawer.m.js';
import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.m.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
import 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js';
import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js';
import 'chrome://resources/polymer/v3_0/paper-styles/shadow.js';
import './audio_settings.js';
import './battery_settings.js';
import './bluetooth_settings.js';
import './icons.js';
import './input_device_settings.js';
import './shared_styles.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
Polymer({ Polymer({
is: 'device-emulator-pages', is: 'device-emulator-pages',
_template: html`{__html_template__}`,
properties: { properties: {
selectedPage: { selectedPage: {
type: Number, type: Number,
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html">
<iron-iconset-svg name="device-emulator" size="24"> <iron-iconset-svg name="device-emulator" size="24">
<svg> <svg>
......
// Copyright 2019 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.
import 'chrome://resources/polymer/v3_0/iron-iconset-svg/iron-iconset-svg.js';
import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
const template = html`{__html_template__}`;
document.head.appendChild(template.content);
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="icons.html">
<link rel="import" href="shared_styles.html">
<dom-module id="input-device-settings">
<template>
<style include="device-emulator-shared-styles iron-flex iron-flex-alignment <style include="device-emulator-shared-styles iron-flex iron-flex-alignment
iron-positioning"> iron-positioning">
.content > *:not(:first-child) { .content > *:not(:first-child) {
...@@ -41,6 +29,3 @@ ...@@ -41,6 +29,3 @@
</iron-collapse> </iron-collapse>
</div> </div>
</div> </div>
</template>
<script src="input_device_settings.js"></script>
</dom-module>
...@@ -2,9 +2,21 @@ ...@@ -2,9 +2,21 @@
// 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.
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.m.js';
import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.m.js';
import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js';
import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
import './icons.js';
import './shared_styles.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
Polymer({ Polymer({
is: 'input-device-settings', is: 'input-device-settings',
_template: html`{__html_template__}`,
behaviors: [WebUIListenerBehavior], behaviors: [WebUIListenerBehavior],
ready: function() { ready: function() {
......
<link rel="import" href="chrome://resources/html/polymer.html">
<dom-module id="device-emulator-shared-styles">
<template> <template>
<style> <style>
cr-icon-button { cr-icon-button {
...@@ -112,4 +110,3 @@ ...@@ -112,4 +110,3 @@
} }
</style> </style>
</template> </template>
</dom-module>
// Copyright 2019 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.
import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
const styleElement = document.createElement('dom-module');
styleElement.setAttribute('assetpath', 'chrome://resources/');
styleElement.innerHTML = `{__html_template__}`;
styleElement.register('device-emulator-shared-styles');
...@@ -23,31 +23,20 @@ content::WebUIDataSource* CreateDeviceEmulatorUIDataSource() { ...@@ -23,31 +23,20 @@ content::WebUIDataSource* CreateDeviceEmulatorUIDataSource() {
content::WebUIDataSource::Create(chrome::kChromeUIDeviceEmulatorHost); content::WebUIDataSource::Create(chrome::kChromeUIDeviceEmulatorHost);
// Add resources. // Add resources.
html->AddResourcePath("audio_settings.html",
IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_HTML);
html->AddResourcePath("audio_settings.js", html->AddResourcePath("audio_settings.js",
IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_JS); IDR_DEVICE_EMULATOR_AUDIO_SETTINGS_JS);
html->AddResourcePath("battery_settings.html",
IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_HTML);
html->AddResourcePath("battery_settings.js", html->AddResourcePath("battery_settings.js",
IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_JS); IDR_DEVICE_EMULATOR_BATTERY_SETTINGS_JS);
html->AddResourcePath("bluetooth_settings.html",
IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_HTML);
html->AddResourcePath("bluetooth_settings.js", html->AddResourcePath("bluetooth_settings.js",
IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_JS); IDR_DEVICE_EMULATOR_BLUETOOTH_SETTINGS_JS);
html->AddResourcePath("icons.html", IDR_DEVICE_EMULATOR_ICONS_HTML); html->AddResourcePath("icons.js", IDR_DEVICE_EMULATOR_ICONS_JS);
html->AddResourcePath("input_device_settings.html",
IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_HTML);
html->AddResourcePath("input_device_settings.js", html->AddResourcePath("input_device_settings.js",
IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_JS); IDR_DEVICE_EMULATOR_INPUT_DEVICE_SETTINGS_JS);
html->AddResourcePath("device_emulator_pages.html",
IDR_DEVICE_EMULATOR_PAGES_HTML);
html->AddResourcePath("device_emulator_pages.js", html->AddResourcePath("device_emulator_pages.js",
IDR_DEVICE_EMULATOR_PAGES_JS); IDR_DEVICE_EMULATOR_PAGES_JS);
html->AddResourcePath("shared_styles.js",
html->AddResourcePath("shared_styles.html", IDR_DEVICE_EMULATOR_SHARED_STYLES_JS);
IDR_DEVICE_EMULATOR_SHARED_STYLES_HTML); html->AddResourcePath("device_emulator.css", IDR_DEVICE_EMULATOR_CSS);
html->SetDefaultResource(IDR_DEVICE_EMULATOR_HTML); html->SetDefaultResource(IDR_DEVICE_EMULATOR_HTML);
return html; return html;
......
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