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

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

Issue 2098633002: Migrate the one-time notice into the MD settings CBD dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_counters
Patch Set: Initialize to false. Created 4 years, 6 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 e5b178c7334dbeba22388b59b7dfd5a8f7b7a5bc..b094d5983c685e4c116ee19ba15728a88f21cd38 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
@@ -51,6 +51,12 @@ Polymer({
/** @private */
clearingInProgress_: Boolean,
+
+ /** @private */
+ showHistoryDeletionDialog_: {
+ type: Boolean,
+ value: false,
+ },
},
/** @private {!settings.ClearBrowsingDataBrowserProxy} */
@@ -120,12 +126,32 @@ Polymer({
this.$.dialog.open();
},
- /** @private */
+ /**
+ * Handles the tap on the Clear Data button.
+ * @private
+ */
onClearBrowsingDataTap_: function() {
this.clearingInProgress_ = true;
- this.browserProxy_.clearBrowsingData().then(function() {
- this.clearingInProgress_ = false;
- this.$.dialog.close();
- }.bind(this));
+ 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)
+ this.$.dialog.close();
+ }.bind(this));
},
+
+ /**
+ * Handles the closing of the notice about other forms of browsing history.
+ * @private
+ */
+ onHistoryDeletionDialogClose_: function() {
+ this.showHistoryDeletionDialog_ = false;
+ this.$.dialog.close();
+ }
});

Powered by Google App Engine
This is Rietveld 408576698