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

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

Issue 1915063003: Change ContentSettingImageView activation to key release (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
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/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 c14256c789cd4355f4de6035cd14667abbc539ea..898af4e6dc71dd2cff3a38902063a5adf1cd3d50 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
@@ -113,11 +113,21 @@ int IconLabelBubbleView::GetImageAndPaddingWidth() const {
return image_->GetPreferredSize().width() + GetInternalSpacing();
}
+bool IconLabelBubbleView::OnActivate() {
+ return false;
+}
+
gfx::Size IconLabelBubbleView::GetPreferredSize() const {
// Height will be ignored by the LocationBarView.
return GetSizeForLabelWidth(label_->GetPreferredSize().width());
}
+bool IconLabelBubbleView::OnKeyReleased(const ui::KeyEvent& event) {
+ if (event.key_code() != ui::VKEY_RETURN && event.key_code() != ui::VKEY_SPACE)
+ return false;
+ return OnActivate();
+}
+
void IconLabelBubbleView::Layout() {
// Compute the image bounds. In non-MD, the leading padding depends on
// whether this is an extension icon, since extension icons and

Powered by Google App Engine
This is Rietveld 408576698