Commit 3f284885 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Settings: Check-in downloads_page/ Polymer 3

Bug: 1069258
Change-Id: I35c918448fe62894cb1c1c088776c9a628f64c12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153004Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760257}
parent c05fe5f1
......@@ -72,7 +72,6 @@ group("closure_compile") {
"basic_page:closure_compile",
"clear_browsing_data_dialog:closure_compile",
"controls:closure_compile",
"downloads_page:closure_compile",
"languages_page:closure_compile",
"people_page:closure_compile",
"prefs:closure_compile",
......
......@@ -4,10 +4,11 @@
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/polymer/polymer.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
import("../settings.gni")
js_type_check("closure_compile") {
js_type_check("closure_compile_module") {
is_polymer3 = true
closure_flags = settings_closure_flags
deps = [
":downloads_browser_proxy",
":downloads_page",
......@@ -15,64 +16,25 @@ js_type_check("closure_compile") {
}
js_library("downloads_browser_proxy") {
deps = [
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
]
deps = [ "//ui/webui/resources/js:cr.m" ]
}
js_library("downloads_page") {
deps = [
":downloads_browser_proxy",
"../prefs:prefs_behavior",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
js_type_check("closure_compile_module") {
is_polymer3 = true
deps = [
":downloads_browser_proxy.m",
":downloads_page.m",
]
}
js_library("downloads_browser_proxy.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.m.js" ]
deps = [ "//ui/webui/resources/js:cr.m" ]
extra_deps = [ ":modulize" ]
}
js_library("downloads_page.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/downloads_page/downloads_page.m.js" ]
deps = [
":downloads_browser_proxy.m",
"../prefs:prefs_behavior.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:util.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
]
extra_deps = [ ":downloads_page_module" ]
}
group("polymer3_elements") {
public_deps = [
":downloads_page_module",
":modulize",
]
public_deps = [ ":downloads_page_module" ]
}
polymer_modulizer("downloads_page") {
js_file = "downloads_page.js"
html_file = "downloads_page.html"
html_type = "dom-module"
namespace_rewrites = settings_namespace_rewrites
auto_imports =
settings_auto_imports + [ "ui/webui/resources/html/util.html|listenOnce" ]
}
js_modulizer("modulize") {
input_files = [ "downloads_browser_proxy.js" ]
namespace_rewrites = settings_namespace_rewrites
html_type = "v3-ready"
}
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<script src="downloads_browser_proxy.js"></script>
......@@ -3,12 +3,11 @@
// found in the LICENSE file.
// clang-format off
// #import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js';
import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js';
// clang-format on
cr.define('settings', function() {
/** @interface */
/* #export */ class DownloadsBrowserProxy {
export class DownloadsBrowserProxy {
initializeDownloads() {}
selectDownloadLocation() {}
resetAutoOpenFileTypes() {}
......@@ -22,9 +21,9 @@ cr.define('settings', function() {
}
/**
* @implements {settings.DownloadsBrowserProxy}
* @implements {DownloadsBrowserProxy}
*/
/* #export */ class DownloadsBrowserProxyImpl {
export class DownloadsBrowserProxyImpl {
/** @override */
initializeDownloads() {
chrome.send('initializeDownloads');
......@@ -43,16 +42,10 @@ cr.define('settings', function() {
// <if expr="chromeos">
/** @override */
getDownloadLocationText(path) {
return cr.sendWithPromise('getDownloadLocationText', path);
return sendWithPromise('getDownloadLocationText', path);
}
// </if>
}
cr.addSingletonGetter(DownloadsBrowserProxyImpl);
addSingletonGetter(DownloadsBrowserProxyImpl);
// #cr_define_end
return {
DownloadsBrowserProxy: DownloadsBrowserProxy,
DownloadsBrowserProxyImpl: DownloadsBrowserProxyImpl,
};
});
<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/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../controls/controlled_button.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="downloads_browser_proxy.html">
<dom-module id="settings-downloads-page">
<template>
<style include="cr-shared-style settings-shared iron-flex">
#defaultDownloadPath {
word-break: break-word;
......@@ -53,6 +38,3 @@
</cr-button>
</div>
</template>
</template>
<script src="downloads_page.js"></script>
</dom-module>
......@@ -7,9 +7,26 @@
* 'settings-downloads-page' is the settings page containing downloads
* settings.
*/
import 'chrome://resources/cr_elements/cr_button/cr_button.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 '../controls/controlled_button.m.js';
import '../controls/settings_toggle_button.m.js';
import '../settings_shared_css.m.js';
import {listenOnce} from 'chrome://resources/js/util.m.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';
import {PrefsBehavior} from '../prefs/prefs_behavior.m.js';
import {DownloadsBrowserProxy, DownloadsBrowserProxyImpl} from './downloads_browser_proxy.js';
Polymer({
is: 'settings-downloads-page',
_template: html`{__html_template__}`,
behaviors: [WebUIListenerBehavior, PrefsBehavior],
properties: {
......@@ -41,12 +58,12 @@ Polymer({
],
// </if>
/** @private {?settings.DownloadsBrowserProxy} */
/** @private {?DownloadsBrowserProxy} */
browserProxy_: null,
/** @override */
created() {
this.browserProxy_ = settings.DownloadsBrowserProxyImpl.getInstance();
this.browserProxy_ = DownloadsBrowserProxyImpl.getInstance();
},
/** @override */
......
......@@ -37,7 +37,7 @@ import 'chrome://resources/cr_components/certificate_manager/certificate_manager
// Sections
import './a11y_page/a11y_page.m.js';
import './downloads_page/downloads_page.m.js';
import './downloads_page/downloads_page.js';
import './languages_page/languages_page.m.js';
import './printing_page/printing_page.js';
import './reset_page/reset_page.js';
......@@ -63,7 +63,7 @@ export {ChromeCleanupProxyImpl} from './chrome_cleanup_page/chrome_cleanup_proxy
export {CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW} from './chrome_cleanup_page/items_to_remove_list.m.js';
// </if>
export {ClearBrowsingDataBrowserProxyImpl} from './clear_browsing_data_dialog/clear_browsing_data_browser_proxy.m.js';
export {DownloadsBrowserProxyImpl} from './downloads_page/downloads_browser_proxy.m.js';
export {DownloadsBrowserProxyImpl} from './downloads_page/downloads_browser_proxy.js';
// <if expr="_google_chrome and is_win">
export {IncompatibleApplication, IncompatibleApplicationsBrowserProxyImpl} from './incompatible_applications_page/incompatible_applications_browser_proxy.m.js';
// </if>
......
......@@ -240,13 +240,12 @@
use_base_dir="false"
compress="false" type="BINDATA" />
</if>
<include name="IDR_SETTINGS_DOWNLOADS_BROWSER_PROXY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.m.js"
use_base_dir="false"
<include name="IDR_SETTINGS_DOWNLOADS_PAGE_DOWNLOADS_BROWSER_PROXY_JS"
file="downloads_page/downloads_browser_proxy.js"
compress="false" type="BINDATA"
preprocess="true" />
<include name="IDR_SETTINGS_DOWNLOADS_PAGE_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/downloads_page/downloads_page.m.js"
<include name="IDR_SETTINGS_DOWNLOADS_PAGE_DOWNLOADS_PAGE_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/downloads_page/downloads_page.js"
use_base_dir="false"
compress="false" type="BINDATA"
preprocess="true" />
......
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