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