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

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

Issue 2240883002: Make ClearBrowsingDataHandler only observe its own removal task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only forward-declare in the header file Created 4 years, 3 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 efe2b054179524563fdfd0fa37984ee861925025..5b94efb3dc3d12e6ed751dffd280df9d3844b92c 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
@@ -50,7 +50,10 @@ Polymer({
},
/** @private */
- clearingInProgress_: Boolean,
+ clearingInProgress_: {
+ type: Boolean,
+ value: false,
+ },
/** @private */
showHistoryDeletionDialog_: {
@@ -65,9 +68,6 @@ 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));
@@ -83,8 +83,7 @@ Polymer({
attached: function() {
this.browserProxy_ =
settings.ClearBrowsingDataBrowserProxyImpl.getInstance();
- this.browserProxy_.initialize().then(function(isRemoving) {
- this.clearingInProgress_ = isRemoving;
+ this.browserProxy_.initialize().then(function() {
this.$.dialog.showModal();
}.bind(this));
},
@@ -139,12 +138,15 @@ 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