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

Unified Diff: chrome/browser/ui/alternate_error_tab_observer.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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 | « chrome/browser/ui/alternate_error_tab_observer.h ('k') | chrome/browser/ui/app_list/apps_model_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/alternate_error_tab_observer.cc
diff --git a/chrome/browser/ui/alternate_error_tab_observer.cc b/chrome/browser/ui/alternate_error_tab_observer.cc
index 73347f4b708b9e4b32b861de77688277becf49bc..569a739389972154f8eed7b7af5e64e29d325f68 100644
--- a/chrome/browser/ui/alternate_error_tab_observer.cc
+++ b/chrome/browser/ui/alternate_error_tab_observer.cc
@@ -56,13 +56,18 @@ void AlternateErrorPageTabObserver::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- DCHECK_EQ(profile_->GetPrefs(), content::Source<PrefService>(source).ptr());
- DCHECK_EQ(std::string(prefs::kAlternateErrorPagesEnabled),
- *content::Details<std::string>(details).ptr());
- } else {
- DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_URL_UPDATED, type);
- }
+ DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_URL_UPDATED, type);
+ UpdateAlternateErrorPageURL(web_contents()->GetRenderViewHost());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// PrefObserver overrides
+
+void AlternateErrorPageTabObserver::OnPreferenceChanged(
+ PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK_EQ(profile_->GetPrefs(), service);
+ DCHECK(prefs::kAlternateErrorPagesEnabled == pref_name);
UpdateAlternateErrorPageURL(web_contents()->GetRenderViewHost());
}
« no previous file with comments | « chrome/browser/ui/alternate_error_tab_observer.h ('k') | chrome/browser/ui/app_list/apps_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698