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/frame/browser_root_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
6 | 6 |
7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
9 #include "chrome/browser/autocomplete/autocomplete_match.h" | 9 #include "chrome/browser/autocomplete/autocomplete_match.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 // tab-strip. | 144 // tab-strip. |
145 if (scroll_offset > 0 && model->active_index() > 0) { | 145 if (scroll_offset > 0 && model->active_index() > 0) { |
146 chrome::SelectPreviousTab(browser); | 146 chrome::SelectPreviousTab(browser); |
147 return true; | 147 return true; |
148 } | 148 } |
149 } | 149 } |
150 } | 150 } |
151 return RootView::OnMouseWheel(event); | 151 return RootView::OnMouseWheel(event); |
152 } | 152 } |
153 | 153 |
154 void BrowserRootView::DispatchGestureEvent(ui::GestureEvent* event) { | 154 ui::EventDispatchDetails BrowserRootView::OnEventFromSource(ui::Event* event) { |
155 if (event->type() == ui::ET_GESTURE_TAP && | 155 if (event->IsGestureEvent()) { |
sky
2014/07/15 20:53:11
I'm not a fan of the static_casts all through out
tdanderson
2014/07/15 21:31:24
Yes, I agree that isolating the static_casts in th
| |
156 event->location().y() <= 0 && | 156 ui::GestureEvent* gesture_event = static_cast<ui::GestureEvent*>(event); |
157 event->location().x() <= browser_view_->GetBounds().width()) { | 157 if (gesture_event->type() == ui::ET_GESTURE_TAP && |
158 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); | 158 gesture_event->location().y() <= 0 && |
159 gesture_event->location().x() <= browser_view_->GetBounds().width()) { | |
160 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); | |
161 } | |
159 } | 162 } |
160 | 163 |
161 RootView::DispatchGestureEvent(event); | 164 return RootView::OnEventFromSource(event); |
162 } | 165 } |
163 | 166 |
164 bool BrowserRootView::ShouldForwardToTabStrip( | 167 bool BrowserRootView::ShouldForwardToTabStrip( |
165 const ui::DropTargetEvent& event) { | 168 const ui::DropTargetEvent& event) { |
166 if (!tabstrip()->visible()) | 169 if (!tabstrip()->visible()) |
167 return false; | 170 return false; |
168 | 171 |
169 // Allow the drop as long as the mouse is over the tabstrip or vertically | 172 // Allow the drop as long as the mouse is over the tabstrip or vertically |
170 // before it. | 173 // before it. |
171 gfx::Point tab_loc_in_host; | 174 gfx::Point tab_loc_in_host; |
(...skipping 29 matching lines...) Expand all Loading... | |
201 browser_view_->browser()->profile())->Classify( | 204 browser_view_->browser()->profile())->Classify( |
202 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, | 205 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, |
203 NULL); | 206 NULL); |
204 if (!match.destination_url.is_valid()) | 207 if (!match.destination_url.is_valid()) |
205 return false; | 208 return false; |
206 | 209 |
207 if (url) | 210 if (url) |
208 *url = match.destination_url; | 211 *url = match.destination_url; |
209 return true; | 212 return true; |
210 } | 213 } |
OLD | NEW |