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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1226093005: Give ProfileChooserView signin button focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 5 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
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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698