Chromium Code Reviews| 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 4ab0eaccaef7eb50ea0bd7767a94b7dcdf443e81..bc2563e644da53b15c22204f91ce6de4eaef7d3d 100644 |
| --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc |
| @@ -20,7 +20,7 @@ ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater) |
| icon_id_(0), |
| tooltip_text_id_(0) { |
| set_id(VIEW_ID_MANAGE_PASSWORDS_ICON_BUTTON); |
| - SetAccessibilityFocusable(true); |
| + SetFocusable(true); |
|
Mike West
2014/08/05 16:42:24
What's the difference?
vasilii
2014/08/06 09:14:01
AccessibilityFocusable means focusable for accessi
|
| UpdateVisibleUI(); |
| } |
| @@ -75,3 +75,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()) |
|
Mike West
2014/08/05 16:41:55
You need to check reverse here. Otherwise shift-ta
vasilii
2014/08/06 09:14:01
Shift-Tab is fine. The focus goes to the bubble to
Mike West
2014/08/06 09:17:46
If I shift-tab out of the bubble, what happens? Pe
|
| + ManagePasswordsBubbleView::ActivateBubble(); |
| +} |