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

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

Issue 2118503005: [MD settings] disable clear browsing data while it is running (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved init to attached 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..6bad6518fc0dd312c6436b76485174654adc873e 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
@@ -66,6 +66,11 @@ Polymer({
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));
this.addWebUIListener(
@@ -74,10 +79,15 @@ Polymer({
this.addWebUIListener(
'update-counter-text',
this.updateCounterText_.bind(this));
+ },
+
+ attached: function() {
dpapad 2016/07/08 18:04:42 Nit: @override
this.browserProxy_ =
settings.ClearBrowsingDataBrowserProxyImpl.getInstance();
- this.browserProxy_.initialize();
- this.$.dialog.open();
+ this.browserProxy_.initialize().then(function() {
+ assert(typeof this.clearingInProgress_ == 'boolean');
dpapad 2016/07/08 18:04:42 Why do we allow this boolean to have a tri-state (
Dan Beam 2016/07/08 19:19:07 because otherwise it's not clear the value is vali
dpapad 2016/07/08 19:21:07 Yes, I think in this case "true" is the appropriat
Dan Beam 2016/07/08 19:27:44 ultimately I don't care, but I think that leaving
+ this.$.dialog.open();
+ }.bind(this));
},
/**
@@ -138,7 +148,6 @@ Polymer({
* 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