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/browser_commands.h" | |
8 #include "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_view_state.h" |
9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
10 | 11 |
11 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) | 12 BubbleIconView::BubbleIconView(CommandUpdater* command_updater, |
13 int command_id, | |
14 Browser* browser) | |
12 : command_updater_(command_updater), | 15 : command_updater_(command_updater), |
13 command_id_(command_id), | 16 command_id_(command_id), |
17 browser_(browser), | |
14 suppress_mouse_released_action_(false) { | 18 suppress_mouse_released_action_(false) { |
15 SetAccessibilityFocusable(true); | 19 SetAccessibilityFocusable(true); |
16 } | 20 } |
17 | 21 |
18 BubbleIconView::~BubbleIconView() { | 22 BubbleIconView::~BubbleIconView() { |
19 } | 23 } |
20 | 24 |
21 void BubbleIconView::GetAccessibleState(ui::AXViewState* state) { | 25 void BubbleIconView::GetAccessibleState(ui::AXViewState* state) { |
22 views::ImageView::GetAccessibleState(state); | 26 views::ImageView::GetAccessibleState(state); |
23 state->role = ui::AX_ROLE_BUTTON; | 27 state->role = ui::AX_ROLE_BUTTON; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 68 |
65 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { | 69 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { |
66 if (event->type() == ui::ET_GESTURE_TAP) { | 70 if (event->type() == ui::ET_GESTURE_TAP) { |
67 ExecuteCommand(EXECUTE_SOURCE_GESTURE); | 71 ExecuteCommand(EXECUTE_SOURCE_GESTURE); |
68 event->SetHandled(); | 72 event->SetHandled(); |
69 } | 73 } |
70 } | 74 } |
71 | 75 |
72 void BubbleIconView::ExecuteCommand(ExecuteSource source) { | 76 void BubbleIconView::ExecuteCommand(ExecuteSource source) { |
73 OnExecuting(source); | 77 OnExecuting(source); |
74 if (command_updater_) | 78 if (browser_) |
75 command_updater_->ExecuteCommand(command_id_); | 79 chrome::BookmarkCurrentPageInternal(browser_); |
Peter Kasting
2014/12/12 01:20:56
This change isn't appropriate for a generic base c
| |
76 } | 80 } |
OLD | NEW |