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

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

Issue 7484040: Multi-Profiles: Only show the avatar icon if user has multiple profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac Created 9 years, 5 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 | « no previous file | chrome/browser/ui/gtk/browser_titlebar.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_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index be6845e560e0f20319c8b6779f56074a943b255f..6df4d70f2622ae63fd30ad400b4c6f103a8af8ca 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -15,9 +15,11 @@
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h" // IDC_*
#include "chrome/browser/bookmarks/bookmark_editor.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_ui_util_mac.h"
@@ -1353,8 +1355,20 @@ typedef NSInteger NSWindowAnimationBehavior;
}
- (BOOL)shouldShowAvatar {
- return [self hasTabStrip] && (browser_->profile()->IsOffTheRecord() ||
- ProfileManager::IsMultipleProfilesEnabled());
+ if (![self hasTabStrip])
+ return NO;
+
+ if (browser_->profile()->IsOffTheRecord())
+ return YES;
+
+ if (ProfileManager::IsMultipleProfilesEnabled()) {
+ // Show the profile avatar after the user has created more than one profile.
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ return cache.GetNumberOfProfiles() > 1;
+ }
+
+ return NO;
}
- (BOOL)isBookmarkBarVisible {
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_titlebar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698