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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm

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 | « no previous file | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 00cb1b3f3749e889836d8ca0177f7f2a825c3f0a..12ee05210f9fa8a014904a84cb7c135ca55b4aec 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
@@ -188,6 +188,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
« no previous file with comments | « no previous file | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698