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..09026e4796282db76b2648c293ad249815c9708d 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) { |
Mike Lerman
2015/02/20 15:34:00
The ProfileManager only shows you the number of Lo
anthonyvd
2015/02/20 19:06:05
Hm, this function is static and the avatar_menu_ o
Mike Lerman
2015/02/20 19:17:09
Ah - I didn't realize the ProfileManager just call
|
+ return; |
+ } |
+ |
if (IsShowing()) { |
if (tutorial_mode != profiles::TUTORIAL_MODE_NONE) { |
profile_bubble_->tutorial_mode_ = tutorial_mode; |
@@ -799,7 +807,7 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, |
avatar_menu_->SwitchToProfile( |
profile_match->second, |
ui::DispositionFromEventFlags(event.flags()) == NEW_WINDOW, |
- ProfileMetrics::SWITCH_PROFILE_ICON); |
+ ProfileMetrics::SWITCH_PROFILE_FAST_SWITCHER); |
} else { |
// This was a profile accounts button. |
AccountButtonIndexes::const_iterator account_match = |