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

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: Revert instrumentation changes. 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
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698