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

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

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/ui/browser.cc ('k') | chrome/browser/ui/gtk/global_menu_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 2c63978f0eacceee23a3e2d62925a6410ba6bd53..ab6c65c14629416b5997858df098f204e67d36cf 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -52,12 +52,13 @@ BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
: browser_(browser),
controller_(controller),
confirm_close_factory_(browser) {
- // This pref applies to all windows, so all must watch for it.
+ // Listen for bookmark bar visibility changes and set the initial state; we
+ // need to listen to all profiles because of normal profile/incognito issues.
registrar_.Add(this,
chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
- NotificationService::AllSources());
+ NotificationService::AllBrowserContextsAndSources());
registrar_.Add(this, chrome::NOTIFICATION_SIDEBAR_CHANGED,
- NotificationService::AllSources());
+ Source<SidebarManager>(SidebarManager::GetInstance()));
}
BrowserWindowCocoa::~BrowserWindowCocoa() {
@@ -608,7 +609,8 @@ void BrowserWindowCocoa::Observe(int type,
// Only the key window gets a direct toggle from the menu.
// Other windows hear about it from the notification.
case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
- [controller_ updateBookmarkBarVisibilityWithAnimation:YES];
+ if (browser_->profile()->IsSameProfile(Source<Profile>(source).ptr()))
+ [controller_ updateBookmarkBarVisibilityWithAnimation:YES];
break;
case chrome::NOTIFICATION_SIDEBAR_CHANGED:
UpdateSidebarForContents(
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/gtk/global_menu_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698