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

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

Issue 2133893002: [MD settings] disable clear browsing data while it is running (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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/clear_browsing_data_dialog/clear_browsing_data_dialog.js
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
index a374304bbeccff3459dc4982ebd92d0a460b319e..b79d1ce38f050f2a1402adb1802ce0e84ec31b83 100644
--- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
+++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
@@ -65,6 +65,9 @@ Polymer({
/** @override */
ready: function() {
this.$.clearFrom.menuOptions = this.clearFromOptions_;
+ this.addWebUIListener('browsing-data-removing', function(isRemoving) {
+ this.clearingInProgress_ = isRemoving;
+ }.bind(this));
this.addWebUIListener(
'browsing-history-pref-changed',
this.setAllowDeletingHistory_.bind(this));
@@ -74,10 +77,16 @@ Polymer({
this.addWebUIListener(
'update-counter-text',
this.updateCounterText_.bind(this));
+ },
+
+ /** @override */
+ attached: function() {
this.browserProxy_ =
settings.ClearBrowsingDataBrowserProxyImpl.getInstance();
- this.browserProxy_.initialize();
- this.$.dialog.open();
+ this.browserProxy_.initialize().then(function(isRemoving) {
+ this.clearingInProgress_ = isRemoving;
+ this.$.dialog.open();
+ }.bind(this));
},
/**
@@ -131,14 +140,12 @@ Polymer({
* @private
*/
onClearBrowsingDataTap_: function() {
- this.clearingInProgress_ = true;
this.browserProxy_.clearBrowsingData().then(
/**
* @param {boolean} shouldShowNotice Whether we should show the notice
* about other forms of browsing history before closing the dialog.
*/
function(shouldShowNotice) {
- this.clearingInProgress_ = false;
this.showHistoryDeletionDialog_ = shouldShowNotice;
if (!shouldShowNotice)

Powered by Google App Engine
This is Rietveld 408576698