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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Rebase Created 4 years, 10 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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 static_cast<const WebGestureEvent&>(event)); 281 static_cast<const WebGestureEvent&>(event));
282 282
283 case WebInputEvent::GestureScrollEnd: 283 case WebInputEvent::GestureScrollEnd:
284 return HandleGestureScrollEnd(static_cast<const WebGestureEvent&>(event)); 284 return HandleGestureScrollEnd(static_cast<const WebGestureEvent&>(event));
285 285
286 case WebInputEvent::GesturePinchBegin: { 286 case WebInputEvent::GesturePinchBegin: {
287 DCHECK(!gesture_pinch_on_impl_thread_); 287 DCHECK(!gesture_pinch_on_impl_thread_);
288 const WebGestureEvent& gesture_event = 288 const WebGestureEvent& gesture_event =
289 static_cast<const WebGestureEvent&>(event); 289 static_cast<const WebGestureEvent&>(event);
290 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad && 290 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad &&
291 input_handler_->HaveWheelEventHandlers()) { 291 input_handler_->GetEventListenerProperties(
292 cc::EventListenerClass::kMouseWheel) !=
293 cc::EventListenerProperties::kNone) {
292 return DID_NOT_HANDLE; 294 return DID_NOT_HANDLE;
293 } else { 295 } else {
294 input_handler_->PinchGestureBegin(); 296 input_handler_->PinchGestureBegin();
295 gesture_pinch_on_impl_thread_ = true; 297 gesture_pinch_on_impl_thread_ = true;
296 return DID_HANDLE; 298 return DID_HANDLE;
297 } 299 }
298 } 300 }
299 301
300 case WebInputEvent::GesturePinchEnd: 302 case WebInputEvent::GesturePinchEnd:
301 if (gesture_pinch_on_impl_thread_) { 303 if (gesture_pinch_on_impl_thread_) {
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 // trigger a scroll, e.g., with a trivial time delta between fling updates. 1171 // trigger a scroll, e.g., with a trivial time delta between fling updates.
1170 // Return true in this case to prevent early fling termination. 1172 // Return true in this case to prevent early fling termination.
1171 if (std::abs(clipped_increment.width) < kScrollEpsilon && 1173 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
1172 std::abs(clipped_increment.height) < kScrollEpsilon) 1174 std::abs(clipped_increment.height) < kScrollEpsilon)
1173 return true; 1175 return true;
1174 1176
1175 return did_scroll; 1177 return did_scroll;
1176 } 1178 }
1177 1179
1178 } // namespace ui 1180 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698