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

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

Issue 8698010: Clear cache after showing Sync confirmation bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/webui/ntp/ntp_login_handler.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f34bd5a13e4bad9c2f3f289753b72d3cddb930d6..e98317547a937e555d3e6e17d0de2bd197e40581 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -176,6 +176,8 @@ NTPResourceCache::NTPResourceCache(Profile* profile) : profile_(profile) {
content::NotificationService::AllSources());
registrar_.Add(this, chrome::NTP4_INTRO_PREF_CHANGED,
content::NotificationService::AllSources());
+ registrar_.Add(this, chrome::NTP4_SYNC_PROMO_SHOW_NTP_BUBBLE_CHANGED,
+ content::NotificationService::AllSources());
// Watch for pref changes that cause us to need to invalidate the HTML cache.
pref_change_registrar_.Init(profile_->GetPrefs());
@@ -217,20 +219,25 @@ void NTPResourceCache::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
// Invalidate the cache.
- if (chrome::NOTIFICATION_BROWSER_THEME_CHANGED == type ||
- chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED == type) {
- new_tab_incognito_html_ = NULL;
- new_tab_html_ = NULL;
- new_tab_incognito_css_ = NULL;
- new_tab_css_ = NULL;
- } else if (chrome::NOTIFICATION_PREF_CHANGED == type ||
- chrome::NTP4_INTRO_PREF_CHANGED) {
- // A change occurred to one of the preferences we care about, so flush the
- // cache.
- new_tab_incognito_html_ = NULL;
- new_tab_html_ = NULL;
- } else {
- NOTREACHED();
+ switch (type) {
+ case chrome::NOTIFICATION_BROWSER_THEME_CHANGED:
+ case chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED:
+ new_tab_incognito_html_ = NULL;
+ new_tab_html_ = NULL;
+ new_tab_incognito_css_ = NULL;
+ new_tab_css_ = NULL;
+ break;
+ case chrome::NOTIFICATION_PREF_CHANGED:
+ case chrome::NTP4_INTRO_PREF_CHANGED:
+ case chrome::NTP4_SYNC_PROMO_SHOW_NTP_BUBBLE_CHANGED:
+ // A change occurred to one of the preferences we care about, so flush the
+ // cache.
+ new_tab_incognito_html_ = NULL;
+ new_tab_html_ = NULL;
+ break;
+ default:
+ NOTREACHED();
+ break;
}
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_login_handler.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698