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()); |
} |