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

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

Issue 95153002: Make touch-based synthetic gesture take touch slop into account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused variable. 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/synthetic_gesture_target_base.h" 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
6 6
7 #include "content/browser/renderer_host/render_widget_host_impl.h" 7 #include "content/browser/renderer_host/render_widget_host_impl.h"
8 #include "content/browser/renderer_host/render_widget_host_view_base.h" 8 #include "content/browser/renderer_host/render_widget_host_view_base.h"
9 #include "content/browser/renderer_host/ui_events_helper.h" 9 #include "content/browser/renderer_host/ui_events_helper.h"
10 #include "content/common/input/input_event.h" 10 #include "content/common/input/input_event.h"
11 #include "content/common/input_messages.h" 11 #include "content/common/input_messages.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h" 12 #include "third_party/WebKit/public/web/WebInputEvent.h"
13 #include "ui/events/event.h" 13 #include "ui/events/event.h"
14 #include "ui/events/latency_info.h" 14 #include "ui/events/latency_info.h"
15 15
16 using blink::WebInputEvent; 16 using blink::WebInputEvent;
17 using blink::WebTouchEvent; 17 using blink::WebTouchEvent;
18 using blink::WebMouseEvent; 18 using blink::WebMouseEvent;
19 using blink::WebMouseWheelEvent; 19 using blink::WebMouseWheelEvent;
20 20
21 namespace content { 21 namespace content {
22 namespace { 22 namespace {
23 23
24 // This value was determined experimentally. It was sufficient to not cause a 24 // This value was determined experimentally. It was sufficient to not cause a
25 // fling on Android. 25 // fling on Android.
26 const int kPointerAssumedStoppedTimeMs = 50; 26 const int kPointerAssumedStoppedTimeMs = 50;
27 27
28 // SyntheticGestureTargetBase passes input events straight on to the renderer
29 // without going through a gesture recognition framework. There is thus no touch
30 // slop.
31 const int kTouchSlopInDips = 0;
32
28 } // namespace 33 } // namespace
29 34
30 SyntheticGestureTargetBase::SyntheticGestureTargetBase( 35 SyntheticGestureTargetBase::SyntheticGestureTargetBase(
31 RenderWidgetHostImpl* host) 36 RenderWidgetHostImpl* host)
32 : host_(host) { 37 : host_(host) {
33 DCHECK(host); 38 DCHECK(host);
34 } 39 }
35 40
36 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() { 41 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() {
37 } 42 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 SyntheticGestureParams::GestureSourceType gesture_source_type) const { 108 SyntheticGestureParams::GestureSourceType gesture_source_type) const {
104 return gesture_source_type == SyntheticGestureParams::MOUSE_INPUT || 109 return gesture_source_type == SyntheticGestureParams::MOUSE_INPUT ||
105 gesture_source_type == SyntheticGestureParams::TOUCH_INPUT; 110 gesture_source_type == SyntheticGestureParams::TOUCH_INPUT;
106 } 111 }
107 112
108 base::TimeDelta SyntheticGestureTargetBase::PointerAssumedStoppedTime() 113 base::TimeDelta SyntheticGestureTargetBase::PointerAssumedStoppedTime()
109 const { 114 const {
110 return base::TimeDelta::FromMilliseconds(kPointerAssumedStoppedTimeMs); 115 return base::TimeDelta::FromMilliseconds(kPointerAssumedStoppedTimeMs);
111 } 116 }
112 117
118 int SyntheticGestureTargetBase::GetTouchSlopInDips() const {
119 return kTouchSlopInDips;
120 }
121
113 } // namespace content 122 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698