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

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: nit 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
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c9ae80cf3ea5c3e34b252a61faf49c5503d1f592 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());
}
@@ -697,6 +701,16 @@ void ProfileChooserView::WindowClosing() {
}
}
+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;
+}
+
void ProfileChooserView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
// Disable button after clicking so that it doesn't get clicked twice and
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698