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

Unified Diff: chrome/browser/ui/views/location_bar/bubble_icon_view.cc

Issue 1947533003: Second try at fixing location bar icon keyboard activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/location_bar/bubble_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
index 830f52c38366d7222e84ca49b5d167e239704f11..af515d320d5ea517e3bc3639431f55bf504f3858 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -98,11 +98,22 @@ void BubbleIconView::OnMouseReleased(const ui::MouseEvent& event) {
ExecuteCommand(EXECUTE_SOURCE_MOUSE);
}
-bool BubbleIconView::OnKeyReleased(const ui::KeyEvent& event) {
- if (event.key_code() != ui::VKEY_SPACE && event.key_code() != ui::VKEY_RETURN)
+bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) {
+ if (event.key_code() != ui::VKEY_RETURN && event.key_code() != ui::VKEY_SPACE)
return false;
ink_drop_delegate_->OnAction(views::InkDropState::ACTIVATED);
+ // As with CustomButton, return activates on key down and space activates on
+ // key up.
Peter Kasting 2016/05/04 02:21:00 Shouldn't we change the ink drop OnAction() call t
Evan Stade 2016/05/04 02:45:52 We want to show the ripple on key down for both sp
Peter Kasting 2016/05/04 02:57:40 o_O Seems, then, like the ripple is basically a "y
Evan Stade 2016/05/04 03:03:57 Perhaps "something is happening or will happen soo
+ if (event.key_code() == ui::VKEY_RETURN)
+ ExecuteCommand(EXECUTE_SOURCE_KEYBOARD);
+ return true;
+}
+
+bool BubbleIconView::OnKeyReleased(const ui::KeyEvent& event) {
+ if (event.key_code() != ui::VKEY_SPACE)
+ return false;
+
ExecuteCommand(EXECUTE_SOURCE_KEYBOARD);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698