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

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

Issue 2027473002: Deprecate use of user gestures during scroll-related touch events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
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 <utility> 9 #include <utility>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 client_(client), 76 client_(client),
77 ack_handler_(ack_handler), 77 ack_handler_(ack_handler),
78 routing_id_(routing_id), 78 routing_id_(routing_id),
79 frame_tree_node_id_(-1), 79 frame_tree_node_id_(-1),
80 select_message_pending_(false), 80 select_message_pending_(false),
81 move_caret_pending_(false), 81 move_caret_pending_(false),
82 mouse_move_pending_(false), 82 mouse_move_pending_(false),
83 current_ack_source_(ACK_SOURCE_NONE), 83 current_ack_source_(ACK_SOURCE_NONE),
84 flush_requested_(false), 84 flush_requested_(false),
85 active_renderer_fling_count_(0), 85 active_renderer_fling_count_(0),
86 touch_scroll_started_sent_(false),
86 wheel_event_queue_(this, 87 wheel_event_queue_(this,
87 UseGestureBasedWheelScrolling(), 88 UseGestureBasedWheelScrolling(),
88 kDefaultWheelScrollTransactionMs), 89 kDefaultWheelScrollTransactionMs),
89 touch_event_queue_(this, config.touch_config), 90 touch_event_queue_(this, config.touch_config),
90 gesture_event_queue_(this, this, config.gesture_config), 91 gesture_event_queue_(this, this, config.gesture_config),
91 device_scale_factor_(1.f) { 92 device_scale_factor_(1.f) {
92 DCHECK(sender); 93 DCHECK(sender);
93 DCHECK(client); 94 DCHECK(client);
94 DCHECK(ack_handler); 95 DCHECK(ack_handler);
95 UpdateTouchAckTimeoutEnabled(); 96 UpdateTouchAckTimeoutEnabled();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 input_stream_validator_.Validate(original_gesture_event.event); 155 input_stream_validator_.Validate(original_gesture_event.event);
155 156
156 GestureEventWithLatencyInfo gesture_event(original_gesture_event); 157 GestureEventWithLatencyInfo gesture_event(original_gesture_event);
157 158
158 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event)) 159 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event))
159 return; 160 return;
160 161
161 wheel_event_queue_.OnGestureScrollEvent(gesture_event); 162 wheel_event_queue_.OnGestureScrollEvent(gesture_event);
162 163
163 if (gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchscreen) { 164 if (gesture_event.event.sourceDevice == blink::WebGestureDeviceTouchscreen) {
164 if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin) 165 if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin) {
166 touch_scroll_started_sent_ = false;
167 } else if(!touch_scroll_started_sent_
168 && gesture_event.event.type ==
169 blink::WebInputEvent::GestureScrollUpdate) {
170 // A touch scroll hasn't really started until the first
171 // GestureScrollUpdate event. Eg. if the page consumes all touchmoves
172 // then no scrolling really ever occurs (even though we still send
173 // GestureScrollBegin).
165 touch_event_queue_.PrependTouchScrollNotification(); 174 touch_event_queue_.PrependTouchScrollNotification();
175 touch_scroll_started_sent_ = true;
176 }
166 touch_event_queue_.OnGestureScrollEvent(gesture_event); 177 touch_event_queue_.OnGestureScrollEvent(gesture_event);
167 } 178 }
168 179
169 gesture_event_queue_.QueueEvent(gesture_event); 180 gesture_event_queue_.QueueEvent(gesture_event);
170 } 181 }
171 182
172 void InputRouterImpl::SendTouchEvent( 183 void InputRouterImpl::SendTouchEvent(
173 const TouchEventWithLatencyInfo& touch_event) { 184 const TouchEventWithLatencyInfo& touch_event) {
174 input_stream_validator_.Validate(touch_event.event); 185 input_stream_validator_.Validate(touch_event.event);
175 touch_event_queue_.QueueEvent(touch_event); 186 touch_event_queue_.QueueEvent(touch_event);
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 650
640 flush_requested_ = false; 651 flush_requested_ = false;
641 client_->DidFlush(); 652 client_->DidFlush();
642 } 653 }
643 654
644 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { 655 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) {
645 frame_tree_node_id_ = frameTreeNodeId; 656 frame_tree_node_id_ = frameTreeNodeId;
646 } 657 }
647 658
648 } // namespace content 659 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698