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 |