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

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

Issue 2782733002: MouseWheelEventQueue sends scrollEnd right away when latching is disabled. (Closed)
Patch Set: nit fixed Created 3 years, 8 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 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (current_phase_ended) { 239 if (current_phase_ended) {
240 // Non-synthetic GSEs are sent when the current phase is canceled or 240 // Non-synthetic GSEs are sent when the current phase is canceled or
241 // ended. 241 // ended.
242 SendScrollEnd(scroll_update, false); 242 SendScrollEnd(scroll_update, false);
243 } else if (has_phase_info) { 243 } else if (has_phase_info) {
244 // Generate a synthetic GSE for every update to force hit testing so 244 // Generate a synthetic GSE for every update to force hit testing so
245 // that the non-latching behavior is preserved. Remove once 245 // that the non-latching behavior is preserved. Remove once
246 // crbug.com/526463 is fully implemented. 246 // crbug.com/526463 is fully implemented.
247 SendScrollEnd(scroll_update, true); 247 SendScrollEnd(scroll_update, true);
248 } else if (!has_phase_info) { 248 } else if (!has_phase_info) {
249 scroll_end_timer_.Start( 249 DCHECK(scroll_transaction_ms_ == 0);
dtapuska 2017/03/29 17:49:03 DCHECK_EQ(0, scroll_transaction_ms_) is preferred.
sahel 2017/03/29 20:10:43 Done.
250 FROM_HERE, 250 SendScrollEnd(scroll_update, false);
251 base::TimeDelta::FromMilliseconds(scroll_transaction_ms_),
252 base::Bind(&MouseWheelEventQueue::SendScrollEnd,
253 base::Unretained(this), scroll_update, false));
254 } 251 }
255 } 252 }
256 } 253 }
257 } 254 }
258 255
259 event_sent_for_gesture_ack_.reset(); 256 event_sent_for_gesture_ack_.reset();
260 TryForwardNextEventToRenderer(); 257 TryForwardNextEventToRenderer();
261 } 258 }
262 259
263 void MouseWheelEventQueue::OnGestureScrollEvent( 260 void MouseWheelEventQueue::OnGestureScrollEvent(
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 scroll_begin.data.scrollBegin.deltaHintUnits = 345 scroll_begin.data.scrollBegin.deltaHintUnits =
349 gesture_update.data.scrollUpdate.deltaUnits; 346 gesture_update.data.scrollUpdate.deltaUnits;
350 347
351 needs_scroll_begin_ = false; 348 needs_scroll_begin_ = false;
352 needs_scroll_end_ = true; 349 needs_scroll_end_ = true;
353 client_->ForwardGestureEventWithLatencyInfo( 350 client_->ForwardGestureEventWithLatencyInfo(
354 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL)); 351 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL));
355 } 352 }
356 353
357 } // namespace content 354 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698