OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/star_view.h" | 5 #include "chrome/browser/ui/views/location_bar/star_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
10 #include "chrome/browser/ui/view_ids.h" | 10 #include "chrome/browser/ui/view_ids.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // We want to show the bubble on mouse release; that is the standard behavior | 55 // We want to show the bubble on mouse release; that is the standard behavior |
56 // for buttons. | 56 // for buttons. |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 void StarView::OnMouseReleased(const ui::MouseEvent& event) { | 60 void StarView::OnMouseReleased(const ui::MouseEvent& event) { |
61 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) | 61 if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) |
62 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); | 62 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); |
63 } | 63 } |
64 | 64 |
65 ui::GestureStatus StarView::OnGestureEvent(const views::GestureEvent& event) { | 65 ui::GestureStatus StarView::OnGestureEvent(const ui::GestureEvent& event) { |
66 if (event.type() == ui::ET_GESTURE_TAP) { | 66 if (event.type() == ui::ET_GESTURE_TAP) { |
67 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); | 67 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); |
68 return ui::GESTURE_STATUS_CONSUMED; | 68 return ui::GESTURE_STATUS_CONSUMED; |
69 } | 69 } |
70 return ui::GESTURE_STATUS_UNKNOWN; | 70 return ui::GESTURE_STATUS_UNKNOWN; |
71 } | 71 } |
72 | 72 |
73 bool StarView::OnKeyPressed(const ui::KeyEvent& event) { | 73 bool StarView::OnKeyPressed(const ui::KeyEvent& event) { |
74 if (event.key_code() == ui::VKEY_SPACE || | 74 if (event.key_code() == ui::VKEY_SPACE || |
75 event.key_code() == ui::VKEY_RETURN) { | 75 event.key_code() == ui::VKEY_RETURN) { |
76 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); | 76 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); |
77 return true; | 77 return true; |
78 } | 78 } |
79 return false; | 79 return false; |
80 } | 80 } |
OLD | NEW |