Chromium Code Reviews| 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..ec40827555f84244923c07458f1b23df55f4ea9d 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,9 @@ Polymer({ |
| path = path.replace(/\//g, ' \u203a '); |
| return path; |
| }, |
| -// </if> |
| + // </if> |
| + |
|
Dan Beam
2017/02/28 02:36:42
nit: @private
tommycli
2017/02/28 17:06:39
Done.
|
| + onClearAutoOpenFileTypesTap_: function() { |
| + this.browserProxy_.resetAutoOpenFileTypes(); |
| + }, |
| }); |