| OLD | NEW |
| 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_android.h
" | 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" |
| 6 | 6 |
| 7 #include "content/browser/android/content_view_core_impl.h" | 7 #include "content/browser/android/content_view_core_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 9 #include "content/common/android/view_configuration.h" |
| 8 #include "jni/TouchEventSynthesizer_jni.h" | 10 #include "jni/TouchEventSynthesizer_jni.h" |
| 9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 11 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 12 #include "ui/gfx/screen.h" |
| 10 | 13 |
| 11 using blink::WebTouchEvent; | 14 using blink::WebTouchEvent; |
| 12 | 15 |
| 13 namespace content { | 16 namespace content { |
| 14 | 17 |
| 15 SyntheticGestureTargetAndroid::SyntheticGestureTargetAndroid( | 18 SyntheticGestureTargetAndroid::SyntheticGestureTargetAndroid( |
| 16 RenderWidgetHostImpl* host, | 19 RenderWidgetHostImpl* host, |
| 17 base::android::ScopedJavaLocalRef<jobject> touch_event_synthesizer) | 20 base::android::ScopedJavaLocalRef<jobject> touch_event_synthesizer) |
| 18 : SyntheticGestureTargetBase(host), | 21 : SyntheticGestureTargetBase(host), |
| 19 touch_event_synthesizer_(touch_event_synthesizer) { | 22 touch_event_synthesizer_(touch_event_synthesizer) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 SyntheticGestureParams::GestureSourceType | 76 SyntheticGestureParams::GestureSourceType |
| 74 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const { | 77 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const { |
| 75 return SyntheticGestureParams::TOUCH_INPUT; | 78 return SyntheticGestureParams::TOUCH_INPUT; |
| 76 } | 79 } |
| 77 | 80 |
| 78 bool SyntheticGestureTargetAndroid::SupportsSyntheticGestureSourceType( | 81 bool SyntheticGestureTargetAndroid::SupportsSyntheticGestureSourceType( |
| 79 SyntheticGestureParams::GestureSourceType gesture_source_type) const { | 82 SyntheticGestureParams::GestureSourceType gesture_source_type) const { |
| 80 return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT; | 83 return gesture_source_type == SyntheticGestureParams::TOUCH_INPUT; |
| 81 } | 84 } |
| 82 | 85 |
| 86 int SyntheticGestureTargetAndroid::GetTouchSlopInDips() const { |
| 87 float device_scale_factor = |
| 88 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor(); |
| 89 return ViewConfiguration::GetTouchSlopInPixels() / device_scale_factor; |
| 90 } |
| 91 |
| 83 } // namespace content | 92 } // namespace content |
| OLD | NEW |