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

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

Issue 1955583002: Second try at fixing location bar icon keyboard activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 898af4e6dc71dd2cff3a38902063a5adf1cd3d50..858109c69a751186e38d3b39acfc4a3d84567611 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -122,10 +122,16 @@ gfx::Size IconLabelBubbleView::GetPreferredSize() const {
return GetSizeForLabelWidth(label_->GetPreferredSize().width());
}
+bool IconLabelBubbleView::OnKeyPressed(const ui::KeyEvent& event) {
+ if (event.key_code() == ui::VKEY_RETURN)
+ return OnActivate();
+ return false;
+}
+
bool IconLabelBubbleView::OnKeyReleased(const ui::KeyEvent& event) {
- if (event.key_code() != ui::VKEY_RETURN && event.key_code() != ui::VKEY_SPACE)
- return false;
- return OnActivate();
+ if (event.key_code() == ui::VKEY_SPACE)
+ return OnActivate();
+ return false;
}
void IconLabelBubbleView::Layout() {

Powered by Google App Engine
This is Rietveld 408576698