Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: chrome/browser/ui/views/frame/browser_root_view.cc

Issue 395563002: Make RootView::DispatchGestureEvent() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_root_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 6ac54d94e37a60e78e28cc2e515e358b00624ca1..7b351862082832fb1cc4ecf1f408c3f76007a684 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -151,14 +151,19 @@ bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
return RootView::OnMouseWheel(event);
}
-void BrowserRootView::DispatchGestureEvent(ui::GestureEvent* event) {
- if (event->type() == ui::ET_GESTURE_TAP &&
- event->location().y() <= 0 &&
- event->location().x() <= browser_view_->GetBounds().width()) {
- TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP);
+ui::EventDispatchDetails BrowserRootView::OnEventFromSource(ui::Event* event) {
+ if (event->IsGestureEvent()) {
+ ui::GestureEvent* gesture_event = static_cast<ui::GestureEvent*>(event);
+ if (gesture_event->type() == ui::ET_GESTURE_TAP &&
+ gesture_event->location().y() <= 0 &&
+ gesture_event->location().x() <= browser_view_->GetBounds().width()) {
+ TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP);
+ }
}
- RootView::DispatchGestureEvent(event);
+ // TODO(tdanderson): Instead call up to EventProcessor::OnEventFromSource()
+ // once RootView::OnEventFromSource() is removed.
sadrul 2014/07/15 18:23:46 You can actually leave this as it is when you remo
tdanderson 2014/07/15 20:25:40 Right, I just thought it would be slightly better
+ return RootView::OnEventFromSource(event);
}
bool BrowserRootView::ShouldForwardToTabStrip(

Powered by Google App Engine
This is Rietveld 408576698