| 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..3ec8dfdfaf317a82e498558d64547b5d873353d0 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} */ ({});
|
| + },
|
| + },
|
| },
|
|
|
| /** @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.$.chromeCleanupLogsUploadControl.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,8 @@ Polymer({
|
| * @private
|
| */
|
| startCleanup_: function() {
|
| - this.browserProxy_.startCleanup();
|
| + this.browserProxy_.startCleanup(
|
| + this.$.chromeCleanupLogsUploadControl.checked);
|
| },
|
|
|
| /**
|
|
|