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

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 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
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",
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698