Chromium Code Reviews| 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/common/android/view_configuration.h" | 5 #include "content/common/android/view_configuration.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "jni/ViewConfiguration_jni.h" | 8 #include "jni/ViewConfiguration_jni.h" |
| 9 | 9 |
| 10 using namespace JNI_ViewConfiguration; | 10 using namespace JNI_ViewConfiguration; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 return Java_ViewConfiguration_getScaledMaximumFlingVelocity(env, view.obj()); | 45 return Java_ViewConfiguration_getScaledMaximumFlingVelocity(env, view.obj()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 int ViewConfiguration::GetMinimumFlingVelocityInPixelsPerSecond() { | 48 int ViewConfiguration::GetMinimumFlingVelocityInPixelsPerSecond() { |
| 49 JNIEnv* env = AttachCurrentThread(); | 49 JNIEnv* env = AttachCurrentThread(); |
| 50 ScopedJavaLocalRef<jobject> view = | 50 ScopedJavaLocalRef<jobject> view = |
| 51 Java_ViewConfiguration_get(env, GetApplicationContext()); | 51 Java_ViewConfiguration_get(env, GetApplicationContext()); |
| 52 return Java_ViewConfiguration_getScaledMinimumFlingVelocity(env, view.obj()); | 52 return Java_ViewConfiguration_getScaledMinimumFlingVelocity(env, view.obj()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 int ViewConfiguration::GetTouchSlopInDips() { | |
| 56 JNIEnv* env = AttachCurrentThread(); | |
| 57 return Java_ViewConfiguration_getTouchSlop(env); | |
|
Dominik Grewe
2013/12/02 12:03:36
This method is actually deprecated (and so are the
jdduke (slow)
2013/12/02 15:51:40
Let's remove the GetTouchSlopInDips() then so peop
| |
| 58 } | |
| 59 | |
| 60 int ViewConfiguration::GetTouchSlopInPixels() { | |
| 61 JNIEnv* env = AttachCurrentThread(); | |
| 62 ScopedJavaLocalRef<jobject> view = | |
| 63 Java_ViewConfiguration_get(env, GetApplicationContext()); | |
| 64 return Java_ViewConfiguration_getScaledTouchSlop(env, view.obj()); | |
| 65 } | |
| 66 | |
| 55 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { | 67 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { |
| 56 return RegisterNativesImpl(env); | 68 return RegisterNativesImpl(env); |
| 57 } | 69 } |
| 58 | 70 |
| 59 } // namespace content | 71 } // namespace content |
| OLD | NEW |