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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 // static 488 // static
489 void ProfileChooserView::ShowBubble( 489 void ProfileChooserView::ShowBubble(
490 profiles::BubbleViewMode view_mode, 490 profiles::BubbleViewMode view_mode,
491 profiles::TutorialMode tutorial_mode, 491 profiles::TutorialMode tutorial_mode,
492 const signin::ManageAccountsParams& manage_accounts_params, 492 const signin::ManageAccountsParams& manage_accounts_params,
493 views::View* anchor_view, 493 views::View* anchor_view,
494 views::BubbleBorder::Arrow arrow, 494 views::BubbleBorder::Arrow arrow,
495 views::BubbleBorder::BubbleAlignment border_alignment, 495 views::BubbleBorder::BubbleAlignment border_alignment,
496 Browser* browser) { 496 Browser* browser) {
497 // Don't start creating the view if it would be an empty fast user switcher.
498 // This is the case when there is 0 or 1 profiles (the current one). It has
499 // to happen here to prevent the view system from creating an empty container.
500 if (view_mode == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER &&
501 g_browser_process->profile_manager()->GetNumberOfProfiles() <= 1) {
502 return;
503 }
504
497 if (IsShowing()) { 505 if (IsShowing()) {
498 if (tutorial_mode != profiles::TUTORIAL_MODE_NONE) { 506 if (tutorial_mode != profiles::TUTORIAL_MODE_NONE) {
499 profile_bubble_->tutorial_mode_ = tutorial_mode; 507 profile_bubble_->tutorial_mode_ = tutorial_mode;
500 profile_bubble_->ShowView(view_mode, profile_bubble_->avatar_menu_.get()); 508 profile_bubble_->ShowView(view_mode, profile_bubble_->avatar_menu_.get());
501 } 509 }
502 return; 510 return;
503 } 511 }
504 512
505 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, 513 profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser,
506 view_mode, tutorial_mode, manage_accounts_params.service_type); 514 view_mode, tutorial_mode, manage_accounts_params.service_type);
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1713 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1706 IncognitoModePrefs::DISABLED; 1714 IncognitoModePrefs::DISABLED;
1707 return incognito_available && !browser_->profile()->IsGuestSession(); 1715 return incognito_available && !browser_->profile()->IsGuestSession();
1708 } 1716 }
1709 1717
1710 void ProfileChooserView::PostActionPerformed( 1718 void ProfileChooserView::PostActionPerformed(
1711 ProfileMetrics::ProfileDesktopMenu action_performed) { 1719 ProfileMetrics::ProfileDesktopMenu action_performed) {
1712 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1720 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1713 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1721 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1714 } 1722 }
OLDNEW
« 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