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

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

Issue 1216933013: [Android] Expose native ViewConfiguration constants as DIPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment and add assert Created 5 years, 5 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/MotionEventSynthesizer_jni.h" 9 #include "jni/MotionEventSynthesizer_jni.h"
10 #include "third_party/WebKit/public/web/WebInputEvent.h" 10 #include "third_party/WebKit/public/web/WebInputEvent.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) { 100 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) {
101 CHECK(false); 101 CHECK(false);
102 } 102 }
103 103
104 SyntheticGestureParams::GestureSourceType 104 SyntheticGestureParams::GestureSourceType
105 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const { 105 SyntheticGestureTargetAndroid::GetDefaultSyntheticGestureSourceType() const {
106 return SyntheticGestureParams::TOUCH_INPUT; 106 return SyntheticGestureParams::TOUCH_INPUT;
107 } 107 }
108 108
109 float SyntheticGestureTargetAndroid::GetTouchSlopInDips() const { 109 float SyntheticGestureTargetAndroid::GetTouchSlopInDips() const {
110 float device_scale_factor = 110 return gfx::ViewConfiguration::GetTouchSlopInDips();
111 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
112 return gfx::ViewConfiguration::GetTouchSlopInPixels() / device_scale_factor;
113 } 111 }
114 112
115 float SyntheticGestureTargetAndroid::GetMinScalingSpanInDips() const { 113 float SyntheticGestureTargetAndroid::GetMinScalingSpanInDips() const {
116 float device_scale_factor = 114 return gfx::ViewConfiguration::GetMinScalingSpanInDips();
117 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().device_scale_factor();
118 return
119 gfx::ViewConfiguration::GetMinScalingSpanInPixels() / device_scale_factor;
120 } 115 }
121 116
122 } // namespace content 117 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698