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

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

Issue 2467023003: Revert "Touchpad scroll latching enabled for Mac behind flag." (Closed)
Patch Set: Created 4 years, 1 month 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/blink/web_input_event_traits.h" 10 #include "ui/events/blink/web_input_event_traits.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // because the events generated will be a GSB (non-synthetic) and GSE 174 // because the events generated will be a GSB (non-synthetic) and GSE
175 // (non-synthetic). This situation arises when OSX generates double 175 // (non-synthetic). This situation arises when OSX generates double
176 // phase end information. 176 // phase end information.
177 bool empty_sequence = 177 bool empty_sequence =
178 !needs_update && needs_scroll_begin_ && current_phase_ended; 178 !needs_update && needs_scroll_begin_ && current_phase_ended;
179 179
180 if (needs_update || !empty_sequence) { 180 if (needs_update || !empty_sequence) {
181 if (needs_scroll_begin_) { 181 if (needs_scroll_begin_) {
182 // If no GSB has been sent, it will be a non-synthetic GSB. 182 // If no GSB has been sent, it will be a non-synthetic GSB.
183 SendScrollBegin(scroll_update, false); 183 SendScrollBegin(scroll_update, false);
184 } else if (has_phase_info && !enable_scroll_latching_) { 184 } else if (has_phase_info) {
185 // If a GSB has been sent, generate a synthetic GSB if we have phase 185 // If a GSB has been sent, generate a synthetic GSB if we have phase
186 // information. This should be removed once crbug.com/526463 is fully 186 // information. This should be removed once crbug.com/526463 is fully
187 // implemented. 187 // implemented.
188 SendScrollBegin(scroll_update, true); 188 SendScrollBegin(scroll_update, true);
189 } 189 }
190 190
191 if (needs_update) { 191 if (needs_update) {
192 ui::LatencyInfo latency = ui::LatencyInfo(ui::SourceEventType::WHEEL); 192 ui::LatencyInfo latency = ui::LatencyInfo(ui::SourceEventType::WHEEL);
193 latency.AddLatencyNumber( 193 latency.AddLatencyNumber(
194 ui::INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, 0, 194 ui::INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, 0,
195 0); 195 0);
196 client_->ForwardGestureEventWithLatencyInfo(scroll_update, latency); 196 client_->ForwardGestureEventWithLatencyInfo(scroll_update, latency);
197 } 197 }
198 198
199 if (current_phase_ended) { 199 if (current_phase_ended) {
200 // Non-synthetic GSEs are sent when the current phase is canceled or 200 // Non-synthetic GSEs are sent when the current phase is canceled or
201 // ended. 201 // ended.
202 SendScrollEnd(scroll_update, false); 202 SendScrollEnd(scroll_update, false);
203 } else if (has_phase_info) { 203 } else if (has_phase_info) {
204 // Generate a synthetic GSE for every update to force hit testing so 204 // Generate a synthetic GSE for every update to force hit testing so
205 // that the non-latching behavior is preserved. Remove once 205 // that the non-latching behavior is preserved. Remove once
206 // crbug.com/526463 is fully implemented. 206 // crbug.com/526463 is fully implemented.
207 if (!enable_scroll_latching_) 207 SendScrollEnd(scroll_update, true);
208 SendScrollEnd(scroll_update, true);
209 } else { 208 } else {
210 scroll_end_timer_.Start( 209 scroll_end_timer_.Start(
211 FROM_HERE, 210 FROM_HERE,
212 base::TimeDelta::FromMilliseconds(scroll_transaction_ms_), 211 base::TimeDelta::FromMilliseconds(scroll_transaction_ms_),
213 base::Bind(&MouseWheelEventQueue::SendScrollEnd, 212 base::Bind(&MouseWheelEventQueue::SendScrollEnd,
214 base::Unretained(this), scroll_update, false)); 213 base::Unretained(this), scroll_update, false));
215 } 214 }
216 } 215 }
217 } 216 }
218 217
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 scroll_begin.data.scrollBegin.deltaHintUnits = 298 scroll_begin.data.scrollBegin.deltaHintUnits =
300 gesture_update.data.scrollUpdate.deltaUnits; 299 gesture_update.data.scrollUpdate.deltaUnits;
301 300
302 needs_scroll_begin_ = false; 301 needs_scroll_begin_ = false;
303 needs_scroll_end_ = true; 302 needs_scroll_end_ = true;
304 client_->ForwardGestureEventWithLatencyInfo( 303 client_->ForwardGestureEventWithLatencyInfo(
305 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL)); 304 scroll_begin, ui::LatencyInfo(ui::SourceEventType::WHEEL));
306 } 305 }
307 306
308 } // namespace content 307 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | content/browser/renderer_host/input/mouse_wheel_event_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698