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

Unified Diff: chrome/browser/ui/browser.cc

Issue 7610003: More. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 4 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
« no previous file with comments | « chrome/browser/extensions/extension_cookies_api.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0c456cddc5fbd8f3ad6164a9c02f89e62fec00ea..04bfc7431d594790390ed008b9bfc897579f4789 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -274,9 +274,11 @@ Browser::Browser(Type type, Profile* profile)
Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_)));
registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED,
NotificationService::AllSources());
+ // We listen to all notification sources because the bookmark bar
+ // state needs to stay in sync between the incognito and normal profiles.
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 +3750,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:
« no previous file with comments | « chrome/browser/extensions/extension_cookies_api.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698