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/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 if (is_source_keyboard) | 523 if (is_source_keyboard) |
524 profile_bubble_->FocusFirstProfileButton(); | 524 profile_bubble_->FocusFirstProfileButton(); |
525 } | 525 } |
526 | 526 |
527 // static | 527 // static |
528 bool ProfileChooserView::IsShowing() { | 528 bool ProfileChooserView::IsShowing() { |
529 return profile_bubble_ != NULL; | 529 return profile_bubble_ != NULL; |
530 } | 530 } |
531 | 531 |
532 // static | 532 // static |
| 533 views::Widget* ProfileChooserView::GetCurrentBubbleWidget() { |
| 534 return profile_bubble_ ? profile_bubble_->GetWidget() : nullptr; |
| 535 } |
| 536 |
| 537 // static |
533 void ProfileChooserView::Hide() { | 538 void ProfileChooserView::Hide() { |
534 if (IsShowing()) | 539 if (IsShowing()) |
535 profile_bubble_->GetWidget()->Close(); | 540 profile_bubble_->GetWidget()->Close(); |
536 } | 541 } |
537 | 542 |
538 ProfileChooserView::ProfileChooserView(views::View* anchor_view, | 543 ProfileChooserView::ProfileChooserView(views::View* anchor_view, |
539 Browser* browser, | 544 Browser* browser, |
540 profiles::BubbleViewMode view_mode, | 545 profiles::BubbleViewMode view_mode, |
541 profiles::TutorialMode tutorial_mode, | 546 profiles::TutorialMode tutorial_mode, |
542 signin::GAIAServiceType service_type, | 547 signin::GAIAServiceType service_type, |
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1846 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1842 IncognitoModePrefs::DISABLED; | 1847 IncognitoModePrefs::DISABLED; |
1843 return incognito_available && !browser_->profile()->IsGuestSession(); | 1848 return incognito_available && !browser_->profile()->IsGuestSession(); |
1844 } | 1849 } |
1845 | 1850 |
1846 void ProfileChooserView::PostActionPerformed( | 1851 void ProfileChooserView::PostActionPerformed( |
1847 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1852 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1848 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1853 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1849 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1854 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1850 } | 1855 } |
OLD | NEW |