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(); |
+} |