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

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

Issue 293683002: Synthetic pinch gesture take scale factor as parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 years, 7 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/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" 8 #include "content/browser/renderer_host/render_widget_host_impl.h"
9 #include "jni/TouchEventSynthesizer_jni.h" 9 #include "jni/TouchEventSynthesizer_jni.h"
10 #include "third_party/WebKit/public/web/WebInputEvent.h" 10 #include "third_party/WebKit/public/web/WebInputEvent.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void SyntheticGestureTargetAndroid::DispatchWebMouseEventToPlatform( 85 void SyntheticGestureTargetAndroid::DispatchWebMouseEventToPlatform(
86 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) { 86 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) {
87 CHECK(false); 87 CHECK(false);
88 } 88 }
89 89
90 SyntheticGestureParams::GestureSourceType 90 SyntheticGestureParams::GestureSourceType
91 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const { 91 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const {
92 return SyntheticGestureParams::TOUCH_INPUT; 92 return SyntheticGestureParams::TOUCH_INPUT;
93 } 93 }
94 94
95 int SyntheticGestureTargetAndroid::GetTouchSlopInDips() const { 95 float SyntheticGestureTargetAndroid::GetTouchSlopInDips() const {
96 float device_scale_factor = 96 float device_scale_factor =
97 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor(); 97 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
98 return gfx::ViewConfiguration::GetTouchSlopInPixels() / device_scale_factor; 98 return gfx::ViewConfiguration::GetTouchSlopInPixels() / device_scale_factor;
99 } 99 }
100 100
101 float SyntheticGestureTargetAndroid::GetMinScalingSpanInDips() const {
102 float device_scale_factor =
103 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
104 return
105 gfx::ViewConfiguration::GetMinScalingSpanInPixels() / device_scale_factor;
106 }
107
101 } // namespace content 108 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698