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

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

Issue 181723006: Handle mac trackpad zoom via GesturePinch events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jdduke CR feedback and fix win build errors Created 6 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 | Annotate | Revision Log
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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 gesture_event_queue_->FlingHasBeenHalted(); 235 gesture_event_queue_->FlingHasBeenHalted();
236 236
237 // Only forward the non-native portions of our event. 237 // Only forward the non-native portions of our event.
238 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut); 238 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut);
239 } 239 }
240 240
241 void InputRouterImpl::SendGestureEvent( 241 void InputRouterImpl::SendGestureEvent(
242 const GestureEventWithLatencyInfo& original_gesture_event) { 242 const GestureEventWithLatencyInfo& original_gesture_event) {
243 event_stream_validator_.OnEvent(original_gesture_event.event); 243 event_stream_validator_.OnEvent(original_gesture_event.event);
244 GestureEventWithLatencyInfo gesture_event(original_gesture_event); 244 GestureEventWithLatencyInfo gesture_event(original_gesture_event);
245
245 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event)) 246 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event))
246 return; 247 return;
247 248
248 touch_event_queue_->OnGestureScrollEvent(gesture_event); 249 touch_event_queue_->OnGestureScrollEvent(gesture_event);
249 250
250 if (!IsInOverscrollGesture() && 251 if (!IsInOverscrollGesture() &&
251 !gesture_event_queue_->ShouldForward(gesture_event)) { 252 !gesture_event_queue_->ShouldForward(gesture_event)) {
252 OverscrollController* controller = client_->GetOverscrollController(); 253 OverscrollController* controller = client_->GetOverscrollController();
253 if (controller) 254 if (controller)
254 controller->DiscardingGestureEvent(gesture_event.event); 255 controller->DiscardingGestureEvent(gesture_event.event);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 413
413 // Any input event cancels a pending mouse move event. 414 // Any input event cancels a pending mouse move event.
414 next_mouse_move_.reset(); 415 next_mouse_move_.reset();
415 416
416 OfferToHandlers(input_event, latency_info, is_keyboard_shortcut); 417 OfferToHandlers(input_event, latency_info, is_keyboard_shortcut);
417 } 418 }
418 419
419 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, 420 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event,
420 const ui::LatencyInfo& latency_info, 421 const ui::LatencyInfo& latency_info,
421 bool is_keyboard_shortcut) { 422 bool is_keyboard_shortcut) {
423 // Trackpad pinch gestures are not yet handled by the renderer.
jdduke (slow) 2014/03/27 02:08:02 Is that true? The compositor currently doesn't dis
424 // TODO(rbyers): Send mousewheel for trackpad pinch - crbug.com/289887.
425 if (input_event.type == WebInputEvent::GesturePinchUpdate &&
426 static_cast<const WebGestureEvent&>(input_event).sourceDevice ==
427 WebGestureEvent::Touchpad) {
428 ProcessInputEventAck(input_event.type,
429 INPUT_EVENT_ACK_STATE_NOT_CONSUMED,
430 latency_info,
431 ACK_SOURCE_NONE);
432 return;
433 }
434
422 if (OfferToOverscrollController(input_event, latency_info)) 435 if (OfferToOverscrollController(input_event, latency_info))
423 return; 436 return;
424 437
425 if (OfferToClient(input_event, latency_info)) 438 if (OfferToClient(input_event, latency_info))
426 return; 439 return;
427 440
428 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut); 441 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut);
429 442
430 // If we don't care about the ack disposition, send the ack immediately. 443 // If we don't care about the ack disposition, send the ack immediately.
431 if (WebInputEventTraits::IgnoresAckDisposition(input_event.type)) { 444 if (WebInputEventTraits::IgnoresAckDisposition(input_event.type)) {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 touch_event_queue_->SetAckTimeoutEnabled(touch_ack_timeout_enabled, 820 touch_event_queue_->SetAckTimeoutEnabled(touch_ack_timeout_enabled,
808 touch_ack_timeout_delay_); 821 touch_ack_timeout_delay_);
809 } 822 }
810 823
811 bool InputRouterImpl::IsInOverscrollGesture() const { 824 bool InputRouterImpl::IsInOverscrollGesture() const {
812 OverscrollController* controller = client_->GetOverscrollController(); 825 OverscrollController* controller = client_->GetOverscrollController();
813 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; 826 return controller && controller->overscroll_mode() != OVERSCROLL_NONE;
814 } 827 }
815 828
816 } // namespace content 829 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698