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

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

Issue 304793003: use enum to specify deviceSource for fling animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased for parallel breaking changes Created 6 years, 6 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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 } 1209 }
1210 1210
1211 InputEventAckState RenderWidgetHostViewAura::FilterInputEvent( 1211 InputEventAckState RenderWidgetHostViewAura::FilterInputEvent(
1212 const blink::WebInputEvent& input_event) { 1212 const blink::WebInputEvent& input_event) {
1213 bool consumed = false; 1213 bool consumed = false;
1214 if (input_event.type == WebInputEvent::GestureFlingStart) { 1214 if (input_event.type == WebInputEvent::GestureFlingStart) {
1215 const WebGestureEvent& gesture_event = 1215 const WebGestureEvent& gesture_event =
1216 static_cast<const WebGestureEvent&>(input_event); 1216 static_cast<const WebGestureEvent&>(input_event);
1217 // Zero-velocity touchpad flings are an Aura-specific signal that the 1217 // Zero-velocity touchpad flings are an Aura-specific signal that the
1218 // touchpad scroll has ended, and should not be forwarded to the renderer. 1218 // touchpad scroll has ended, and should not be forwarded to the renderer.
1219 if (gesture_event.sourceDevice == WebGestureEvent::Touchpad && 1219 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad &&
1220 !gesture_event.data.flingStart.velocityX && 1220 !gesture_event.data.flingStart.velocityX &&
1221 !gesture_event.data.flingStart.velocityY) { 1221 !gesture_event.data.flingStart.velocityY) {
1222 consumed = true; 1222 consumed = true;
1223 } 1223 }
1224 } 1224 }
1225 1225
1226 if (overscroll_controller_) 1226 if (overscroll_controller_)
1227 consumed |= overscroll_controller_->WillHandleEvent(input_event); 1227 consumed |= overscroll_controller_->WillHandleEvent(input_event);
1228 1228
1229 return consumed && !WebTouchEvent::isTouchEventType(input_event.type) 1229 return consumed && !WebTouchEvent::isTouchEventType(input_event.type)
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 event->details().touch_points() == 1) { 1977 event->details().touch_points() == 1) {
1978 delegate->HandleGestureBegin(); 1978 delegate->HandleGestureBegin();
1979 } 1979 }
1980 1980
1981 blink::WebGestureEvent gesture = MakeWebGestureEvent(event); 1981 blink::WebGestureEvent gesture = MakeWebGestureEvent(event);
1982 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 1982 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
1983 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an 1983 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an
1984 // event to stop any in-progress flings. 1984 // event to stop any in-progress flings.
1985 blink::WebGestureEvent fling_cancel = gesture; 1985 blink::WebGestureEvent fling_cancel = gesture;
1986 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; 1986 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel;
1987 fling_cancel.sourceDevice = blink::WebGestureEvent::Touchscreen; 1987 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
1988 host_->ForwardGestureEvent(fling_cancel); 1988 host_->ForwardGestureEvent(fling_cancel);
1989 } 1989 }
1990 1990
1991 if (gesture.type != blink::WebInputEvent::Undefined) { 1991 if (gesture.type != blink::WebInputEvent::Undefined) {
1992 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency()); 1992 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency());
1993 1993
1994 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 1994 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
1995 event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 1995 event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
1996 event->type() == ui::ET_GESTURE_SCROLL_END) { 1996 event->type() == ui::ET_GESTURE_SCROLL_END) {
1997 RecordAction(base::UserMetricsAction("TouchscreenScroll")); 1997 RecordAction(base::UserMetricsAction("TouchscreenScroll"));
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 2434
2435 //////////////////////////////////////////////////////////////////////////////// 2435 ////////////////////////////////////////////////////////////////////////////////
2436 // RenderWidgetHostViewBase, public: 2436 // RenderWidgetHostViewBase, public:
2437 2437
2438 // static 2438 // static
2439 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2439 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2440 GetScreenInfoForWindow(results, NULL); 2440 GetScreenInfoForWindow(results, NULL);
2441 } 2441 }
2442 2442
2443 } // namespace content 2443 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698