OLD | NEW |
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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 layout->AddView(sub_view); | 947 layout->AddView(sub_view); |
948 Layout(); | 948 Layout(); |
949 if (GetBubbleFrameView()) | 949 if (GetBubbleFrameView()) |
950 SizeToContents(); | 950 SizeToContents(); |
951 if (view_to_focus) | 951 if (view_to_focus) |
952 view_to_focus->RequestFocus(); | 952 view_to_focus->RequestFocus(); |
953 } | 953 } |
954 | 954 |
955 void ProfileChooserView::ShowViewFromMode(profiles::BubbleViewMode mode) { | 955 void ProfileChooserView::ShowViewFromMode(profiles::BubbleViewMode mode) { |
956 if (SigninViewController::ShouldShowModalSigninForMode(mode)) { | 956 if (SigninViewController::ShouldShowModalSigninForMode(mode)) { |
| 957 // Hides the user menu if it is currently shown. The user menu automatically |
| 958 // closes when it loses focus; however, on Windows, the signin modals do not |
| 959 // take away focus, thus we need to manually close the bubble. |
| 960 Hide(); |
957 browser_->ShowModalSigninWindow(mode, access_point_); | 961 browser_->ShowModalSigninWindow(mode, access_point_); |
958 } else { | 962 } else { |
959 ShowView(mode, avatar_menu_.get()); | 963 ShowView(mode, avatar_menu_.get()); |
960 } | 964 } |
961 } | 965 } |
962 | 966 |
963 void ProfileChooserView::WindowClosing() { | 967 void ProfileChooserView::WindowClosing() { |
964 DCHECK_EQ(profile_bubble_, this); | 968 DCHECK_EQ(profile_bubble_, this); |
965 profile_bubble_ = NULL; | 969 profile_bubble_ = NULL; |
966 | 970 |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2303 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2300 IncognitoModePrefs::DISABLED; | 2304 IncognitoModePrefs::DISABLED; |
2301 return incognito_available && !browser_->profile()->IsGuestSession(); | 2305 return incognito_available && !browser_->profile()->IsGuestSession(); |
2302 } | 2306 } |
2303 | 2307 |
2304 void ProfileChooserView::PostActionPerformed( | 2308 void ProfileChooserView::PostActionPerformed( |
2305 ProfileMetrics::ProfileDesktopMenu action_performed) { | 2309 ProfileMetrics::ProfileDesktopMenu action_performed) { |
2306 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 2310 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
2307 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 2311 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
2308 } | 2312 } |
OLD | NEW |