Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc |
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
index 296028e87a506f759d2c6baeec28f9476d33fa5a..7f7b143d40bbc2320a8cf6fca4039eb053519fbf 100644 |
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
@@ -494,6 +494,14 @@ void ProfileChooserView::ShowBubble( |
views::BubbleBorder::Arrow arrow, |
views::BubbleBorder::BubbleAlignment border_alignment, |
Browser* browser) { |
+ // 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 view system from creating an empty container. |
+ if (view_mode == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER && |
+ g_browser_process->profile_manager()->GetNumberOfProfiles() <= 1) { |
+ return; |
+ } |
+ |
if (IsShowing()) { |
if (tutorial_mode != profiles::TUTORIAL_MODE_NONE) { |
profile_bubble_->tutorial_mode_ = tutorial_mode; |