| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 5 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/command_updater.h" | 7 #include "chrome/browser/command_updater.h" |
| 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 9 #include "ui/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 | 11 |
| 12 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) | 12 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) |
| 13 : command_updater_(command_updater), | 13 : command_updater_(command_updater), |
| 14 command_id_(command_id), | 14 command_id_(command_id), |
| 15 suppress_mouse_released_action_(false) { | 15 suppress_mouse_released_action_(false) { |
| 16 set_accessibility_focusable(true); | 16 SetAccessibilityFocusable(true); |
| 17 LocationBarView::InitTouchableLocationBarChildView(this); | 17 LocationBarView::InitTouchableLocationBarChildView(this); |
| 18 } | 18 } |
| 19 | 19 |
| 20 BubbleIconView::~BubbleIconView() { | 20 BubbleIconView::~BubbleIconView() { |
| 21 } | 21 } |
| 22 | 22 |
| 23 void BubbleIconView::GetAccessibleState(ui::AccessibleViewState* state) { | 23 void BubbleIconView::GetAccessibleState(ui::AccessibleViewState* state) { |
| 24 views::ImageView::GetAccessibleState(state); | 24 views::ImageView::GetAccessibleState(state); |
| 25 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 25 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
| 26 } | 26 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return false; | 67 return false; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { | 70 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { |
| 71 if (event->type() == ui::ET_GESTURE_TAP) { | 71 if (event->type() == ui::ET_GESTURE_TAP) { |
| 72 OnExecuting(EXECUTE_SOURCE_GESTURE); | 72 OnExecuting(EXECUTE_SOURCE_GESTURE); |
| 73 command_updater_->ExecuteCommand(command_id_); | 73 command_updater_->ExecuteCommand(command_id_); |
| 74 event->SetHandled(); | 74 event->SetHandled(); |
| 75 } | 75 } |
| 76 } | 76 } |
| OLD | NEW |