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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc

Issue 440903002: Password "key" icon in the omnibox should be focusable. If the bubble is open then it automatically… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 4 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/passwords/manage_passwords_icon_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/passwords/manage_passwords_icon_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
index 58cef816fe33113aa4d25e0485295069dd52c4de..e651c2c2587377f32713445b95a941f07b8aa239 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
@@ -16,7 +16,7 @@
ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater)
: BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE) {
set_id(VIEW_ID_MANAGE_PASSWORDS_ICON_BUTTON);
- SetAccessibilityFocusable(true);
+ SetFocusable(true);
UpdateVisibleUI();
}
@@ -56,3 +56,23 @@ bool ManagePasswordsIconView::OnMousePressed(const ui::MouseEvent& event) {
ManagePasswordsBubbleView::CloseBubble();
return result;
}
+
+bool ManagePasswordsIconView::OnKeyPressed(const ui::KeyEvent& event) {
+ // Space is always ignored because otherwise the bubble appears with the
+ // default button down. Releasing the space is equivalent to clicking this
+ // button.
+ if (event.key_code() == ui::VKEY_SPACE)
+ return true;
+ if (event.key_code() == ui::VKEY_RETURN && active()) {
+ // If the icon is active, it should transfer its focus to the bubble.
+ // If it still somehow got this key event, the bubble shouldn't be reopened.
+ return true;
+ }
+ return BubbleIconView::OnKeyPressed(event);
+}
+
+void ManagePasswordsIconView::AboutToRequestFocusFromTabTraversal(
+ bool reverse) {
+ if (active())
+ ManagePasswordsBubbleView::ActivateBubble();
+}
« no previous file with comments | « chrome/browser/ui/views/passwords/manage_passwords_icon_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698