Chromium Code Reviews| 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) |