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

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: 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
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 e1d8109199c0f37b0dae5e53b03e584bb728429c..a4db49752487cd1d8ba89d33a56bee7f3a953ce9 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -15,6 +15,7 @@
#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"
@@ -1323,8 +1324,20 @@ typedef NSInteger NSWindowAnimationBehavior;
}
- (BOOL)shouldShowAvatar {
Robert Sesek 2011/07/24 13:56:37 Use YES/NO return values rather than true/false.
sail 2011/08/03 20:51:49 Done.
- return [self hasTabStrip] && (browser_->profile()->IsOffTheRecord() ||
- ProfileManager::IsMultipleProfilesEnabled());
+ if (![self hasTabStrip])
+ return false;
+
+ if (browser_->profile()->IsOffTheRecord())
+ return true;
+
+ if (ProfileManager::IsMultipleProfilesEnabled()) {
+ // Show the profile avatar after the user has create more than one profile.
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ return cache.GetNumberOfProfiles() > 1;
+ }
+
+ return false;
}
- (BOOL)isBookmarkBarVisible {
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_titlebar.cc » ('j') | chrome/browser/ui/views/frame/browser_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698