| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 if (is_source_keyboard) | 537 if (is_source_keyboard) |
| 538 profile_bubble_->FocusFirstProfileButton(); | 538 profile_bubble_->FocusFirstProfileButton(); |
| 539 } | 539 } |
| 540 | 540 |
| 541 // static | 541 // static |
| 542 bool ProfileChooserView::IsShowing() { | 542 bool ProfileChooserView::IsShowing() { |
| 543 return profile_bubble_ != NULL; | 543 return profile_bubble_ != NULL; |
| 544 } | 544 } |
| 545 | 545 |
| 546 // static | 546 // static |
| 547 views::Widget* ProfileChooserView::GetCurrentBubbleWidget() { |
| 548 return profile_bubble_ ? profile_bubble_->GetWidget() : nullptr; |
| 549 } |
| 550 |
| 551 // static |
| 547 void ProfileChooserView::Hide() { | 552 void ProfileChooserView::Hide() { |
| 548 if (IsShowing()) | 553 if (IsShowing()) |
| 549 profile_bubble_->GetWidget()->Close(); | 554 profile_bubble_->GetWidget()->Close(); |
| 550 } | 555 } |
| 551 | 556 |
| 552 ProfileChooserView::ProfileChooserView(views::View* anchor_view, | 557 ProfileChooserView::ProfileChooserView(views::View* anchor_view, |
| 553 Browser* browser, | 558 Browser* browser, |
| 554 profiles::BubbleViewMode view_mode, | 559 profiles::BubbleViewMode view_mode, |
| 555 profiles::TutorialMode tutorial_mode, | 560 profiles::TutorialMode tutorial_mode, |
| 556 signin::GAIAServiceType service_type, | 561 signin::GAIAServiceType service_type, |
| (...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1859 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1855 IncognitoModePrefs::DISABLED; | 1860 IncognitoModePrefs::DISABLED; |
| 1856 return incognito_available && !browser_->profile()->IsGuestSession(); | 1861 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1857 } | 1862 } |
| 1858 | 1863 |
| 1859 void ProfileChooserView::PostActionPerformed( | 1864 void ProfileChooserView::PostActionPerformed( |
| 1860 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1865 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1861 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1866 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1862 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1867 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1863 } | 1868 } |
| OLD | NEW |