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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm

Issue 944563002: Fix fast user switcher appearance when empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/profiles/avatar_base_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
index 66a424ad327b0aeb50b151867c7b65c4f1ac496d..07898bc68f9ac8d73a98a74ce8b3273d9cddf48c 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
@@ -187,6 +187,14 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver,
profiles::TutorialMode tutorialMode;
profiles::BubbleViewModeFromAvatarBubbleMode(
mode, &viewMode, &tutorialMode);
+ // Don't start creating the view if it would be an empty fast user switcher.
+ // This is the case when there is 0 or 1 profiles (the current one). It has
+ // to happen here to prevent the creation of an empty container.
+ if (viewMode == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER &&
+ g_browser_process->profile_manager()->GetNumberOfProfiles() <= 1) {
+ return;
+ }
+
menuController_ =
[[ProfileChooserController alloc] initWithBrowser:browser_
anchoredAt:point

Powered by Google App Engine
This is Rietveld 408576698