Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 0c456cddc5fbd8f3ad6164a9c02f89e62fec00ea..e1dcf0e2b10a881f0904a20e1043fc750de855fc 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -274,9 +274,10 @@ Browser::Browser(Type type, Profile* profile) |
Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); |
registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, |
NotificationService::AllSources()); |
+ // Need to stay in sync between our incognito and our normal profile. |
Peter Kasting
2011/08/10 21:30:15
Nit: "We listen to all notification sources becaus
|
registrar_.Add(this, |
chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
- Source<Profile>(profile_)); |
+ NotificationService::AllBrowserContextsAndSources()); |
// Need to know when to alert the user of theme install delay. |
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL, |
@@ -3748,8 +3749,8 @@ void Browser::Observe(int type, |
break; |
case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: |
- DCHECK_EQ(Source<Profile>(source).ptr(), profile_); |
- UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); |
+ if (profile_->IsSameProfile(Source<Profile>(source).ptr())) |
+ UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); |
break; |
default: |