Skip to content

Commit

Permalink
WebUI: Add a dummy Polymer3 WebUI demo page for experimentation.
Browse files Browse the repository at this point in the history
This page is "parked" temporarily under chrome://print/polymer3/demo.html,
and only included for optimize_webui=false, to avoid the overhead of
adding a new top-level WebUI page, and should be removed once
experimentation concludes.

Bug: 965770
Change-Id: I9de73ccbdbd1150bc7ca73f09fe8b81d973ff0e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613704
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664086}
  • Loading branch information
freshp86 authored and Commit Bot committed May 29, 2019
1 parent 3d86d18 commit 12b3c47
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
},
'parserOptions': {
'ecmaVersion': 2017,
'sourceType': 'module',
},
'rules': {
// Enabled checks.
Expand Down
11 changes: 11 additions & 0 deletions chrome/browser/resources/print_preview/polymer3/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Polymer 3 WebUI demo</title>
<script type="module" src="demo.js"></script>
</head>
<body>
<hello-polymer3></hello-polymer3>
</body>
</html>
31 changes: 31 additions & 0 deletions chrome/browser/resources/print_preview/polymer3/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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/paper-button/paper-button.js';

import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer-element.js';

class HelloPolymer3Element extends PolymerElement {
static get template() {
return html`
<div>Hello Polymer3 [[time]]</div>
<paper-button on-click="onClick_">Update time</paper-button>
`;
}

static get properties() {
return {
time: {
type: Number,
value: Date.now(),
},
};
}

onClick_() {
this.time = Date.now();
}
} // class HelloPolymer3

customElements.define('hello-polymer3', HelloPolymer3Element);
12 changes: 12 additions & 0 deletions chrome/browser/resources/print_preview/print_preview_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@
<structure name="IDR_PRINT_PREVIEW_ICONS_HTML"
file="icons.html"
type="chrome_html" />

<if expr="not optimize_webui">
<!-- TODO(crbug.com/965770): The folowing 2 files are unrelated to Print
Preview, they are only used during Polymer 3 experimentation, and
should be removed after experimentation concludes. -->
<structure name="IDR_PRINT_PREVIEW_POLYMER3_DEMO_HTML"
file="polymer3/demo.html"
type="chrome_html" />
<structure name="IDR_PRINT_PREVIEW_POLYMER3_DEMO_JS"
file="polymer3/demo.js"
type="chrome_html" />
</if>
</structures>
</release>
</grit>

0 comments on commit 12b3c47

Please sign in to comment.