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

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

Issue 2630603002: Revert of Touchpad and wheel scroll latching for ChromeOS behind flag. (Closed)
Patch Set: Created 3 years, 11 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/renderer/input/input_handler_wrapper.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mouse_wheel_event_queue.h" 5 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "ui/events/base_event_utils.h" 10 #include "ui/events/base_event_utils.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 scroll_end_timer_.Reset(); 271 scroll_end_timer_.Reset();
272 task.Run(); 272 task.Run();
273 } 273 }
274 scrolling_device_ = gesture_event.event.sourceDevice; 274 scrolling_device_ = gesture_event.event.sourceDevice;
275 } else if (scrolling_device_ == gesture_event.event.sourceDevice && 275 } else if (scrolling_device_ == gesture_event.event.sourceDevice &&
276 (gesture_event.event.type == 276 (gesture_event.event.type ==
277 blink::WebInputEvent::GestureScrollEnd || 277 blink::WebInputEvent::GestureScrollEnd ||
278 gesture_event.event.type == 278 gesture_event.event.type ==
279 blink::WebInputEvent::GestureFlingStart)) { 279 blink::WebInputEvent::GestureFlingStart)) {
280 scrolling_device_ = blink::WebGestureDeviceUninitialized; 280 scrolling_device_ = blink::WebGestureDeviceUninitialized;
281 if (scroll_end_timer_.IsRunning()) { 281 if (scroll_end_timer_.IsRunning())
282 if (enable_scroll_latching_) { 282 scroll_end_timer_.Reset();
283 // Don't send the pending ScrollEnd if a fling is happening.
284 // The next wheel event will still need a ScrollBegin.
285 scroll_end_timer_.Stop();
286 needs_scroll_begin_ = true;
287 needs_scroll_end_ = false;
288 } else {
289 scroll_end_timer_.Reset();
290 }
291 }
292 } 283 }
293 } 284 }
294 285
295 void MouseWheelEventQueue::TryForwardNextEventToRenderer() { 286 void MouseWheelEventQueue::TryForwardNextEventToRenderer() {
296 TRACE_EVENT0("input", "MouseWheelEventQueue::TryForwardNextEventToRenderer"); 287 TRACE_EVENT0("input", "MouseWheelEventQueue::TryForwardNextEventToRenderer");
297 288
298 if (wheel_queue_.empty() || event_sent_for_gesture_ack_) 289 if (wheel_queue_.empty() || event_sent_for_gesture_ack_)
299 return; 290 return;
300 291
301 event_sent_for_gesture_ack_ = std::move(wheel_queue_.front()); 292 event_sent_for_gesture_ack_ = std::move(wheel_queue_.front());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 scroll_begin.data.scrollBegin.deltaHintUnits = 339 scroll_begin.data.scrollBegin.deltaHintUnits =
349 gesture_update.data.scrollUpdate.deltaUnits; 340 gesture_update.data.scrollUpdate.deltaUnits;
350 341
351 needs_scroll_begin_ = false; 342 needs_scroll_begin_ = false;
352 needs_scroll_end_ = true; 343 needs_scroll_end_ = true;
353 client_->ForwardGestureEventWithLatencyInfo( 344 client_->ForwardGestureEventWithLatencyInfo(
354 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL)); 345 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL));
355 } 346 }
356 347
357 } // namespace content 348 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/input_handler_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698