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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

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/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..2ad6b4a7007db8b8f43cb05c23e12988e600fce5 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -494,6 +494,15 @@ void ProfileChooserView::ShowBubble(
views::BubbleBorder::Arrow arrow,
views::BubbleBorder::BubbleAlignment border_alignment,
Browser* browser) {
+
Alexei Svitkine (slow) 2015/02/19 22:24:28 Nit: No empty line in start of function body.
anthonyvd 2015/02/20 15:01:31 Done.
+ // 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;
@@ -799,7 +808,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);
Mike Lerman 2015/02/20 14:40:57 Don't we want to send SWITCH_PROFILE_FAST_SWITCHER
anthonyvd 2015/02/20 15:01:31 You're absolutely right but SWITCH_PROFILE_ICON is
Mike Lerman 2015/02/20 15:33:59 We can always determine whether someone's in the N
anthonyvd 2015/02/20 19:06:05 Ah! I didn't think about separating by experiment.
} else {
// This was a profile accounts button.
AccountButtonIndexes::const_iterator account_match =

Powered by Google App Engine
This is Rietveld 408576698