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

Unified Diff: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc

Issue 2585633003: Restart counters when the MD CBD dialog is reopened. (Closed)
Patch Set: Remove the duplicate Restart() Created 3 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
index a2e2b3ab706bcfdf3b66f3f0d243970f945de2df..b0cfede934007ab277ff334565c476ffc69086b9 100644
--- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
@@ -255,6 +255,10 @@ void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) {
OnStateChanged();
RefreshHistoryNotice();
+ // Restart the counters each time the dialog is reopened.
+ for (const auto& counter : counters_)
+ counter->Restart();
+
ResolveJavascriptCallback(
*callback_id,
*base::Value::CreateNullValue() /* Promise<void> */);
@@ -310,7 +314,6 @@ void ClearBrowsingDataHandler::AddCounter(
counter->Init(profile_->GetPrefs(),
base::Bind(&ClearBrowsingDataHandler::UpdateCounterText,
base::Unretained(this)));
- counter->Restart();
counters_.push_back(std::move(counter));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698