Chromium Code Reviews| Index: chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js |
| diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js |
| index 89dd30b24ae5ae34f797d10f2159d27c7117bcdd..ea110cee281e20e593e79634f2e7e438464b8cbc 100644 |
| --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js |
| +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js |
| @@ -66,9 +66,9 @@ Polymer({ |
| }, |
| /** @private */ |
| - detailsDescription: { |
| - type: String, |
| - value: '', |
| + showLogsPermission_: { |
| + type: Boolean, |
| + value: false, |
| }, |
| /** @private */ |
| @@ -94,6 +94,14 @@ Polymer({ |
| type: String, |
| value: '', |
| }, |
| + |
| + /** @private {chrome.settingsPrivate.PrefObject} */ |
| + logsUploadPref_: { |
| + type: Object, |
| + value: function() { |
| + return /** @type {chrome.settingsPrivate.PrefObject} */ ({}); |
|
ftirelo
2017/07/05 19:02:25
Are () required here?
proberge
2017/07/05 20:14:20
Maybe not, but all examples I could find do:
https
|
| + }, |
| + }, |
| }, |
| /** @private {?settings.ChromeCleanupProxy} */ |
| @@ -123,6 +131,9 @@ Polymer({ |
| 'chrome-cleanup-on-reboot-required', this.onRebootRequired_.bind(this)); |
| this.addWebUIListener( |
| 'chrome-cleanup-on-dismiss', this.onDismiss_.bind(this)); |
| + this.addWebUIListener( |
| + 'chrome-cleanup-upload-permission-change', |
| + this.onUploadPermissionChange_.bind(this)); |
| this.browserProxy_.registerChromeCleanerObserver(); |
| }, |
| @@ -214,6 +225,7 @@ Polymer({ |
| this.resetIcon_(); |
| this.disableActionButton_(); |
| this.enableDetails_(files); |
| + this.showLogsPermission_ = false; |
| }, |
| /** |
| @@ -242,6 +254,27 @@ Polymer({ |
| }, |
| /** |
| + * @param {boolean} enabled Whether logs upload is enabled. |
| + * @private |
| + */ |
| + onUploadPermissionChange_: function(enabled) { |
| + this.logsUploadPref_ = { |
| + key: '', |
| + type: chrome.settingsPrivate.PrefType.BOOLEAN, |
| + value: enabled, |
| + }; |
| + }, |
| + |
| + /** |
| + * @param {boolean} enabled Whether to enable logs upload. |
| + * @private |
| + */ |
| + changeLogsPermission_: function(enabled) { |
| + var enabled = this.$.logsUploadControl.checked; |
| + this.browserProxy_.setLogsUploadPermission(enabled); |
| + }, |
| + |
| + /** |
| * Dismiss the card. |
| * @private |
| */ |
| @@ -278,7 +311,7 @@ Polymer({ |
| */ |
| disableDetails_: function() { |
| this.showDetails_ = false; |
| - this.detailsDescription = ''; |
| + this.showLogsPermission_ = false; |
| this.showFilesToRemove_ = false; |
| this.filesToRemove_ = []; |
| }, |
| @@ -290,7 +323,7 @@ Polymer({ |
| */ |
| enableDetails_: function(files) { |
| this.showDetails_ = true; |
| - this.detailsDescription = this.i18n('chromeCleanupExplanation'); |
| + this.showLogsPermission_ = true; |
| // Note: doesn't change the state of this.showFilesToRemove_. |
| this.filesToRemove_ = files; |
| }, |
| @@ -300,7 +333,7 @@ Polymer({ |
| * @private |
| */ |
| startCleanup_: function() { |
| - this.browserProxy_.startCleanup(); |
| + this.browserProxy_.startCleanup(this.$.logsUploadControl.checked); |
| }, |
| /** |