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..d74f32937b6aa3edd0a181bb149c653e97b45caf 100644 |
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc |
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc |
@@ -49,17 +49,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 +64,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_); |
+} |