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

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

Issue 93733005: Implement support for touch-action: pan-x/pan-y in chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply jdduke CR feedback Created 7 years 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 key_queue_.push_back(key_event); 190 key_queue_.push_back(key_event);
191 HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); 191 HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size());
192 192
193 gesture_event_filter_->FlingHasBeenHalted(); 193 gesture_event_filter_->FlingHasBeenHalted();
194 194
195 // Only forward the non-native portions of our event. 195 // Only forward the non-native portions of our event.
196 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut); 196 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut);
197 } 197 }
198 198
199 void InputRouterImpl::SendGestureEvent( 199 void InputRouterImpl::SendGestureEvent(
200 const GestureEventWithLatencyInfo& gesture_event) { 200 const GestureEventWithLatencyInfo& original_gesture_event) {
201 if (touch_action_filter_.FilterGestureEvent(gesture_event.event)) 201 GestureEventWithLatencyInfo gesture_event(original_gesture_event);
202 if (touch_action_filter_.FilterGestureEvent(&gesture_event.event))
202 return; 203 return;
203 204
204 touch_event_queue_->OnGestureScrollEvent(gesture_event); 205 touch_event_queue_->OnGestureScrollEvent(gesture_event);
205 206
206 if (!IsInOverscrollGesture() && 207 if (!IsInOverscrollGesture() &&
207 !gesture_event_filter_->ShouldForward(gesture_event)) { 208 !gesture_event_filter_->ShouldForward(gesture_event)) {
208 OverscrollController* controller = client_->GetOverscrollController(); 209 OverscrollController* controller = client_->GetOverscrollController();
209 if (controller) 210 if (controller)
210 controller->DiscardingGestureEvent(gesture_event.event); 211 controller->DiscardingGestureEvent(gesture_event.event);
211 return; 212 return;
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 break; 721 break;
721 } 722 }
722 } 723 }
723 724
724 bool InputRouterImpl::IsInOverscrollGesture() const { 725 bool InputRouterImpl::IsInOverscrollGesture() const {
725 OverscrollController* controller = client_->GetOverscrollController(); 726 OverscrollController* controller = client_->GetOverscrollController();
726 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; 727 return controller && controller->overscroll_mode() != OVERSCROLL_NONE;
727 } 728 }
728 729
729 } // namespace content 730 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698