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/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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 bool ProfileChooserView::AcceleratorPressed( | 730 bool ProfileChooserView::AcceleratorPressed( |
731 const ui::Accelerator& accelerator) { | 731 const ui::Accelerator& accelerator) { |
732 if (accelerator.key_code() != ui::VKEY_DOWN && | 732 if (accelerator.key_code() != ui::VKEY_DOWN && |
733 accelerator.key_code() != ui::VKEY_UP) | 733 accelerator.key_code() != ui::VKEY_UP) |
734 return BubbleDelegateView::AcceleratorPressed(accelerator); | 734 return BubbleDelegateView::AcceleratorPressed(accelerator); |
735 // Move the focus up or down. | 735 // Move the focus up or down. |
736 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); | 736 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); |
737 return true; | 737 return true; |
738 } | 738 } |
739 | 739 |
| 740 views::View* ProfileChooserView::GetInitiallyFocusedView() { |
| 741 return signin_current_profile_link_; |
| 742 } |
| 743 |
740 bool ProfileChooserView::HandleContextMenu( | 744 bool ProfileChooserView::HandleContextMenu( |
741 const content::ContextMenuParams& params) { | 745 const content::ContextMenuParams& params) { |
742 // Suppresses the context menu because some features, such as inspecting | 746 // Suppresses the context menu because some features, such as inspecting |
743 // elements, are not appropriate in a bubble. | 747 // elements, are not appropriate in a bubble. |
744 return true; | 748 return true; |
745 } | 749 } |
746 | 750 |
747 void ProfileChooserView::ButtonPressed(views::Button* sender, | 751 void ProfileChooserView::ButtonPressed(views::Button* sender, |
748 const ui::Event& event) { | 752 const ui::Event& event) { |
749 if (sender == users_button_) { | 753 if (sender == users_button_) { |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1752 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1749 IncognitoModePrefs::DISABLED; | 1753 IncognitoModePrefs::DISABLED; |
1750 return incognito_available && !browser_->profile()->IsGuestSession(); | 1754 return incognito_available && !browser_->profile()->IsGuestSession(); |
1751 } | 1755 } |
1752 | 1756 |
1753 void ProfileChooserView::PostActionPerformed( | 1757 void ProfileChooserView::PostActionPerformed( |
1754 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1758 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1755 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1759 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1756 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1760 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1757 } | 1761 } |
OLD | NEW |