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

Side by Side Diff: content/browser/renderer_host/input/gesture_event_queue.cc

Issue 2918053002: Move middle-click autoscroll to synthetic fling. (Closed)
Patch Set: Delete redundant cursor shape print Created 3 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gesture_event_queue.h" 5 #include "content/browser/renderer_host/input/gesture_event_queue.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" 8 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h"
9 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h" 9 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h"
10 #include "ui/events/blink/blink_features.h" 10 #include "ui/events/blink/blink_features.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 !ShouldDiscardFlingCancelEvent(gesture_event); 109 !ShouldDiscardFlingCancelEvent(gesture_event);
110 } 110 }
111 111
112 bool GestureEventQueue::ShouldForwardForTapSuppression( 112 bool GestureEventQueue::ShouldForwardForTapSuppression(
113 const GestureEventWithLatencyInfo& gesture_event) { 113 const GestureEventWithLatencyInfo& gesture_event) {
114 switch (gesture_event.event.GetType()) { 114 switch (gesture_event.event.GetType()) {
115 case WebInputEvent::kGestureFlingCancel: 115 case WebInputEvent::kGestureFlingCancel:
116 if (gesture_event.event.source_device == 116 if (gesture_event.event.source_device ==
117 blink::kWebGestureDeviceTouchscreen) 117 blink::kWebGestureDeviceTouchscreen)
118 touchscreen_tap_suppression_controller_.GestureFlingCancel(); 118 touchscreen_tap_suppression_controller_.GestureFlingCancel();
119 else 119 else if (gesture_event.event.source_device ==
120 blink::kWebGestureDeviceTouchpad)
120 touchpad_tap_suppression_controller_.GestureFlingCancel(); 121 touchpad_tap_suppression_controller_.GestureFlingCancel();
121 return true; 122 return true;
122 case WebInputEvent::kGestureTapDown: 123 case WebInputEvent::kGestureTapDown:
123 case WebInputEvent::kGestureShowPress: 124 case WebInputEvent::kGestureShowPress:
124 case WebInputEvent::kGestureTapUnconfirmed: 125 case WebInputEvent::kGestureTapUnconfirmed:
125 case WebInputEvent::kGestureTapCancel: 126 case WebInputEvent::kGestureTapCancel:
126 case WebInputEvent::kGestureTap: 127 case WebInputEvent::kGestureTap:
127 case WebInputEvent::kGestureDoubleTap: 128 case WebInputEvent::kGestureDoubleTap:
128 case WebInputEvent::kGestureLongPress: 129 case WebInputEvent::kGestureLongPress:
129 case WebInputEvent::kGestureLongTap: 130 case WebInputEvent::kGestureLongTap:
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // Ack'ing an event may enqueue additional gesture events. By ack'ing the 237 // Ack'ing an event may enqueue additional gesture events. By ack'ing the
237 // event before the forwarding of queued events below, such additional events 238 // event before the forwarding of queued events below, such additional events
238 // can be coalesced with existing queued events prior to dispatch. 239 // can be coalesced with existing queued events prior to dispatch.
239 client_->OnGestureEventAck(event_with_latency, ack_result); 240 client_->OnGestureEventAck(event_with_latency, ack_result);
240 241
241 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); 242 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result);
242 if (type == WebInputEvent::kGestureFlingCancel) { 243 if (type == WebInputEvent::kGestureFlingCancel) {
243 if (event_with_latency.event.source_device == 244 if (event_with_latency.event.source_device ==
244 blink::kWebGestureDeviceTouchscreen) 245 blink::kWebGestureDeviceTouchscreen)
245 touchscreen_tap_suppression_controller_.GestureFlingCancelAck(processed); 246 touchscreen_tap_suppression_controller_.GestureFlingCancelAck(processed);
246 else 247 else if (event_with_latency.event.source_device ==
248 blink::kWebGestureDeviceTouchpad)
247 touchpad_tap_suppression_controller_.GestureFlingCancelAck(processed); 249 touchpad_tap_suppression_controller_.GestureFlingCancelAck(processed);
248 } 250 }
249 DCHECK_LT(event_index, coalesced_gesture_events_.size()); 251 DCHECK_LT(event_index, coalesced_gesture_events_.size());
250 coalesced_gesture_events_.erase(coalesced_gesture_events_.begin() + 252 coalesced_gesture_events_.erase(coalesced_gesture_events_.begin() +
251 event_index); 253 event_index);
252 254
253 // Events have been forwarded already. 255 // Events have been forwarded already.
254 if (allow_multiple_inflight_events_) 256 if (allow_multiple_inflight_events_)
255 return; 257 return;
256 258
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 return 0; 404 return 0;
403 405
404 if (!ignore_next_ack_) 406 if (!ignore_next_ack_)
405 return 1; 407 return 1;
406 408
407 DCHECK_GT(coalesced_gesture_events_.size(), 1U); 409 DCHECK_GT(coalesced_gesture_events_.size(), 1U);
408 return 2; 410 return 2;
409 } 411 }
410 412
411 } // namespace content 413 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698