Index: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc |
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc |
index 153dcfade03592b2636d757332bdca63e4bb3542..cdd87301f892fffd0382443ac6ad9ae2dc46b060 100644 |
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc |
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc |
@@ -218,12 +218,6 @@ void NTPResourceCache::Observe(int type, |
new_tab_html_ = NULL; |
new_tab_incognito_css_ = NULL; |
new_tab_css_ = NULL; |
- } else if (chrome::NOTIFICATION_PREF_CHANGED == type) { |
- // A change occurred to one of the preferences we care about, so flush the |
- // cache. |
- new_tab_incognito_html_ = NULL; |
- new_tab_html_ = NULL; |
- new_tab_css_ = NULL; |
} else if (chrome::NOTIFICATION_NTP_BACKGROUND_THEME_Y_POS_CHANGED == type) { |
css_background_y_pos_ = *(content::Details<int>(details).ptr()); |
if (new_tab_css_.get()) |
@@ -233,6 +227,15 @@ void NTPResourceCache::Observe(int type, |
} |
} |
+void NTPResourceCache::OnPreferenceChanged(PrefServiceBase* service, |
+ const std::string& pref_name) { |
+ // A change occurred to one of the preferences we care about, so flush the |
+ // cache. |
+ new_tab_incognito_html_ = NULL; |
+ new_tab_html_ = NULL; |
+ new_tab_css_ = NULL; |
+} |
+ |
void NTPResourceCache::CreateNewTabIncognitoHTML() { |
DictionaryValue localized_strings; |
localized_strings.SetString("title", |