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/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/bookmarks/bookmark_utils.h" | 10 #include "chrome/browser/bookmarks/bookmark_utils.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 event.key_code() == ui::VKEY_RETURN) { | 73 event.key_code() == ui::VKEY_RETURN) { |
74 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", | 74 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", |
75 bookmark_utils::ENTRY_POINT_STAR_KEY, | 75 bookmark_utils::ENTRY_POINT_STAR_KEY, |
76 bookmark_utils::ENTRY_POINT_LIMIT); | 76 bookmark_utils::ENTRY_POINT_LIMIT); |
77 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE_FROM_STAR); | 77 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE_FROM_STAR); |
78 return true; | 78 return true; |
79 } | 79 } |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 ui::EventResult StarView::OnGestureEvent(ui::GestureEvent* event) { | 83 void StarView::OnGestureEvent(ui::GestureEvent* event) { |
84 if (event->type() == ui::ET_GESTURE_TAP) { | 84 if (event->type() == ui::ET_GESTURE_TAP) { |
85 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", | 85 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", |
86 bookmark_utils::ENTRY_POINT_STAR_GESTURE, | 86 bookmark_utils::ENTRY_POINT_STAR_GESTURE, |
87 bookmark_utils::ENTRY_POINT_LIMIT); | 87 bookmark_utils::ENTRY_POINT_LIMIT); |
88 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE_FROM_STAR); | 88 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE_FROM_STAR); |
89 return ui::ER_CONSUMED; | 89 event->SetHandled(); |
90 } | 90 } |
91 return ui::ER_UNHANDLED; | |
92 } | 91 } |
OLD | NEW |