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

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

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 11 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/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 9db933397170af8013a6643b091276f4bf1eb118..6d263d8ca56762c400a4828244b9a1e76c2a838c 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,7 +255,7 @@ void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) {
// Needed because WebUI doesn't handle renderer crashes. See crbug.com/610450.
task_observer_.reset();
- OnStateChanged();
+ UpdateSyncState();
RefreshHistoryNotice();
// Restart the counters each time the dialog is reopened.
@@ -267,7 +267,11 @@ void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) {
*base::Value::CreateNullValue() /* Promise<void> */);
}
-void ClearBrowsingDataHandler::OnStateChanged() {
+void ClearBrowsingDataHandler::OnStateChanged(syncer::SyncService* sync) {
+ UpdateSyncState();
+}
+
+void ClearBrowsingDataHandler::UpdateSyncState() {
CallJavascriptFunction(
"cr.webUIListenerCallback",
base::StringValue("update-footer"),
@@ -300,7 +304,7 @@ void ClearBrowsingDataHandler::RefreshHistoryNotice() {
void ClearBrowsingDataHandler::UpdateHistoryNotice(bool show) {
show_history_footer_ = show;
- OnStateChanged();
+ UpdateSyncState();
UMA_HISTOGRAM_BOOLEAN(
"History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated",

Powered by Google App Engine
This is Rietveld 408576698