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

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

Issue 420533002: zoom bubble: Close if anchor is clicked while bubble is showing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 2 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 68949b4b160a48130c4fb31599daf7028c4684b2..a850759d5568ae95050f79e637896b4414843602 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -8,6 +8,9 @@
#include "ui/accessibility/ax_view_state.h"
#include "ui/events/event.h"
+BubbleIconView::BubbleIconView() : command_updater_(nullptr), command_id_(0) {
msw 2014/10/24 00:00:55 This ctor should also SetAccessibilityFocusable(tr
Dan Beam 2014/10/24 00:26:19 meh, just removed this ctor
+}
+
BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id)
: command_updater_(command_updater),
command_id_(command_id),
@@ -49,17 +52,14 @@ void BubbleIconView::OnMouseReleased(const ui::MouseEvent& event) {
return;
}
- if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) {
- OnExecuting(EXECUTE_SOURCE_MOUSE);
- command_updater_->ExecuteCommand(command_id_);
- }
+ if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location()))
+ ExecuteCommand(EXECUTE_SOURCE_MOUSE);
}
bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) {
if (event.key_code() == ui::VKEY_SPACE ||
event.key_code() == ui::VKEY_RETURN) {
- OnExecuting(EXECUTE_SOURCE_KEYBOARD);
- command_updater_->ExecuteCommand(command_id_);
+ ExecuteCommand(EXECUTE_SOURCE_KEYBOARD);
return true;
}
return false;
@@ -67,8 +67,13 @@ bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) {
void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
- OnExecuting(EXECUTE_SOURCE_GESTURE);
- command_updater_->ExecuteCommand(command_id_);
+ ExecuteCommand(EXECUTE_SOURCE_GESTURE);
event->SetHandled();
}
}
+
+void BubbleIconView::ExecuteCommand(ExecuteSource source) {
+ OnExecuting(source);
+ if (command_updater_)
+ command_updater_->ExecuteCommand(command_id_);
+}

Powered by Google App Engine
This is Rietveld 408576698