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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR. Created 8 years, 2 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/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 4d88b4db3cc7f85d0021457efe3c891a00eb9e73..8277c54d66441e2050e282b2bbfef6db5b4178d8 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -219,12 +219,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())
@@ -234,6 +228,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",

Powered by Google App Engine
This is Rietveld 408576698