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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10826209: gestures: Generate only either scroll-end or fling-start events at the end of a scroll gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-fix Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 delegate->HandleGestureBegin(); 1311 delegate->HandleGestureBegin();
1312 } 1312 }
1313 1313
1314 WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event); 1314 WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event);
1315 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 1315 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
1316 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an 1316 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an
1317 // event to stop any in-progress flings. 1317 // event to stop any in-progress flings.
1318 WebKit::WebGestureEvent fling_cancel = gesture; 1318 WebKit::WebGestureEvent fling_cancel = gesture;
1319 fling_cancel.type = WebKit::WebInputEvent::GestureFlingCancel; 1319 fling_cancel.type = WebKit::WebInputEvent::GestureFlingCancel;
1320 host_->ForwardGestureEvent(fling_cancel); 1320 host_->ForwardGestureEvent(fling_cancel);
1321 } else if (event->type() == ui::ET_SCROLL_FLING_START) {
1322 // WebKit requires that a scroll ends first before a fling starts.
rjkroege 2012/08/09 16:51:06 It is planned to remove this requirement on WebKit
sadrul 2012/08/09 17:44:02 Nice! My impression was that it was still necessar
1323 WebKit::WebGestureEvent scroll_end = gesture;
1324 gesture.type = WebKit::WebInputEvent::GestureScrollEnd;
1325 host_->ForwardGestureEvent(scroll_end);
1321 } 1326 }
1322 1327
1323 if (gesture.type != WebKit::WebInputEvent::Undefined) { 1328 if (gesture.type != WebKit::WebInputEvent::Undefined) {
1324 host_->ForwardGestureEvent(gesture); 1329 host_->ForwardGestureEvent(gesture);
1325 1330
1326 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 1331 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
1327 event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 1332 event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
1328 event->type() == ui::ET_GESTURE_SCROLL_END) { 1333 event->type() == ui::ET_GESTURE_SCROLL_END) {
1329 RecordAction(UserMetricsAction("TouchscreenScroll")); 1334 RecordAction(UserMetricsAction("TouchscreenScroll"));
1330 } else if (event->type() == ui::ET_SCROLL_FLING_START) { 1335 } else if (event->type() == ui::ET_SCROLL_FLING_START) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 RenderWidgetHost* widget) { 1660 RenderWidgetHost* widget) {
1656 return new RenderWidgetHostViewAura(widget); 1661 return new RenderWidgetHostViewAura(widget);
1657 } 1662 }
1658 1663
1659 // static 1664 // static
1660 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1665 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1661 GetScreenInfoForWindow(results, NULL); 1666 GetScreenInfoForWindow(results, NULL);
1662 } 1667 }
1663 1668
1664 } // namespace content 1669 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698