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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 void InputRouterImpl::SendGestureEvent( 175 void InputRouterImpl::SendGestureEvent(
176 const GestureEventWithLatencyInfo& original_gesture_event) { 176 const GestureEventWithLatencyInfo& original_gesture_event) {
177 event_stream_validator_.OnEvent(original_gesture_event.event); 177 event_stream_validator_.OnEvent(original_gesture_event.event);
178 GestureEventWithLatencyInfo gesture_event(original_gesture_event); 178 GestureEventWithLatencyInfo gesture_event(original_gesture_event);
179 179
180 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event)) 180 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event))
181 return; 181 return;
182 182
183 if (gesture_event.event.sourceDevice == WebGestureEvent::Touchscreen) 183 if (gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchscreen)
184 touch_event_queue_.OnGestureScrollEvent(gesture_event); 184 touch_event_queue_.OnGestureScrollEvent(gesture_event);
185 185
186 if (!gesture_event_queue_.ShouldForward(gesture_event)) 186 if (!gesture_event_queue_.ShouldForward(gesture_event))
187 return; 187 return;
188 188
189 SendGestureEventImmediately(gesture_event); 189 SendGestureEventImmediately(gesture_event);
190 } 190 }
191 191
192 void InputRouterImpl::SendTouchEvent( 192 void InputRouterImpl::SendTouchEvent(
193 const TouchEventWithLatencyInfo& touch_event) { 193 const TouchEventWithLatencyInfo& touch_event) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // to send a touch-action response without racing against the ack timeout. 226 // to send a touch-action response without racing against the ack timeout.
227 UpdateTouchAckTimeoutEnabled(); 227 UpdateTouchAckTimeoutEnabled();
228 } 228 }
229 229
230 FilterAndSendWebInputEvent(touch_event.event, touch_event.latency, false); 230 FilterAndSendWebInputEvent(touch_event.event, touch_event.latency, false);
231 } 231 }
232 232
233 void InputRouterImpl::SendGestureEventImmediately( 233 void InputRouterImpl::SendGestureEventImmediately(
234 const GestureEventWithLatencyInfo& gesture_event) { 234 const GestureEventWithLatencyInfo& gesture_event) {
235 if (gesture_event.event.type == WebInputEvent::GesturePinchUpdate && 235 if (gesture_event.event.type == WebInputEvent::GesturePinchUpdate &&
236 gesture_event.event.sourceDevice == WebGestureEvent::Touchpad) { 236 gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchpad) {
237 SendSyntheticWheelEventForPinch(gesture_event); 237 SendSyntheticWheelEventForPinch(gesture_event);
238 return; 238 return;
239 } 239 }
240 240
241 FilterAndSendWebInputEvent(gesture_event.event, gesture_event.latency, false); 241 FilterAndSendWebInputEvent(gesture_event.event, gesture_event.latency, false);
242 } 242 }
243 243
244 const NativeWebKeyboardEvent* InputRouterImpl::GetLastKeyboardEvent() const { 244 const NativeWebKeyboardEvent* InputRouterImpl::GetLastKeyboardEvent() const {
245 if (key_queue_.empty()) 245 if (key_queue_.empty())
246 return NULL; 246 return NULL;
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 InputRouterImpl::QueuedWheelEvent::QueuedWheelEvent( 686 InputRouterImpl::QueuedWheelEvent::QueuedWheelEvent(
687 const MouseWheelEventWithLatencyInfo& event, 687 const MouseWheelEventWithLatencyInfo& event,
688 bool synthesized_from_pinch) 688 bool synthesized_from_pinch)
689 : event(event), synthesized_from_pinch(synthesized_from_pinch) { 689 : event(event), synthesized_from_pinch(synthesized_from_pinch) {
690 } 690 }
691 691
692 InputRouterImpl::QueuedWheelEvent::~QueuedWheelEvent() { 692 InputRouterImpl::QueuedWheelEvent::~QueuedWheelEvent() {
693 } 693 }
694 694
695 } // namespace content 695 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698