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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 591263002: [Win] Allow using the arrow keys for tabbing in the avatar bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 13521e65a0cde7acc9ac5650856fe1c0e5aeee6c..1937a4ca1ead3732e6f10dead8365baa599f1945 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -597,6 +597,10 @@ void ProfileChooserView::Init() {
view_mode_ = profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT;
}
+ // The arrow keys can be used to tab between items.
+ AddAccelerator(ui::Accelerator(ui::VKEY_DOWN, ui::EF_NONE));
+ AddAccelerator(ui::Accelerator(ui::VKEY_UP, ui::EF_NONE));
+
ShowView(view_mode_, avatar_menu_.get());
}
@@ -873,6 +877,16 @@ bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender,
return false;
}
+bool ProfileChooserView::AcceleratorPressed(
+ const ui::Accelerator& accelerator) {
+ if (accelerator.key_code() != ui::VKEY_DOWN &&
+ accelerator.key_code() != ui::VKEY_UP)
+ return BubbleDelegateView::AcceleratorPressed(accelerator);
+ // Move the focus up or down.
+ GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN);
+ return true;
+}
+
views::View* ProfileChooserView::CreateProfileChooserView(
AvatarMenu* avatar_menu) {
views::View* view = new views::View();

Powered by Google App Engine
This is Rietveld 408576698