Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: chrome/browser/resources/settings/downloads_page/downloads_page.js

Issue 2713343003: MD Settings: Add "Auto Open" setting to Downloads page UI. (Closed)
Patch Set: format Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/downloads_page/downloads_page.js
diff --git a/chrome/browser/resources/settings/downloads_page/downloads_page.js b/chrome/browser/resources/settings/downloads_page/downloads_page.js
index f1d1fc68f578565751ebae4bad82fe06adf3e0d3..143180c5900894dde385f354aa8706b0d203e61b 100644
--- a/chrome/browser/resources/settings/downloads_page/downloads_page.js
+++ b/chrome/browser/resources/settings/downloads_page/downloads_page.js
@@ -18,6 +18,8 @@
Polymer({
is: 'settings-downloads-page',
+ behaviors: [WebUIListenerBehavior],
+
properties: {
/**
* Preferences state.
@@ -32,14 +34,34 @@ Polymer({
* @type {!DownloadsPageVisibility}
*/
pageVisibility: Object,
+
+ /** @private */
+ autoOpenDownloads_: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
+ /** @private {?settings.DownloadsBrowserProxy} */
+ browserProxy_: null,
+
+ /** @override */
+ attached: function() {
+ this.browserProxy_ = settings.DownloadsBrowserProxyImpl.getInstance();
+
+ this.addWebUIListener('auto-open-downloads-changed', function(autoOpen) {
+ this.autoOpenDownloads_ = autoOpen;
+ }.bind(this));
+
+ this.browserProxy_.initializeDownloads();
},
/** @private */
selectDownloadLocation_: function() {
- chrome.send('selectDownloadLocation');
+ this.browserProxy_.selectDownloadLocation();
},
-// <if expr="chromeos">
+ // <if expr="chromeos">
/**
* @param {string} path
* @return {string} The download location string that is suitable to display
@@ -56,5 +78,10 @@ Polymer({
path = path.replace(/\//g, ' \u203a ');
return path;
},
-// </if>
+ // </if>
+
+ /** @private */
+ onClearAutoOpenFileTypesTap_: function() {
+ this.browserProxy_.resetAutoOpenFileTypes();
+ },
});

Powered by Google App Engine
This is Rietveld 408576698