| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/gfx/android/view_configuration.h" | 5 #include "ui/gfx/android/view_configuration.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "jni/ViewConfigurationHelper_jni.h" | 10 #include "jni/ViewConfigurationHelper_jni.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 DISALLOW_COPY_AND_ASSIGN(ViewConfigurationData); | 136 DISALLOW_COPY_AND_ASSIGN(ViewConfigurationData); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 // Leaky to allow access from any thread. | 139 // Leaky to allow access from any thread. |
| 140 base::LazyInstance<ViewConfigurationData>::Leaky g_view_configuration = | 140 base::LazyInstance<ViewConfigurationData>::Leaky g_view_configuration = |
| 141 LAZY_INSTANCE_INITIALIZER; | 141 LAZY_INSTANCE_INITIALIZER; |
| 142 | 142 |
| 143 } // namespace | 143 } // namespace |
| 144 | 144 |
| 145 static void UpdateSharedViewConfiguration(JNIEnv* env, | 145 static void UpdateSharedViewConfiguration(JNIEnv* env, |
| 146 jobject obj, | 146 const JavaParamRef<jobject>& obj, |
| 147 jfloat maximum_fling_velocity, | 147 jfloat maximum_fling_velocity, |
| 148 jfloat minimum_fling_velocity, | 148 jfloat minimum_fling_velocity, |
| 149 jfloat touch_slop, | 149 jfloat touch_slop, |
| 150 jfloat double_tap_slop, | 150 jfloat double_tap_slop, |
| 151 jfloat min_scaling_span, | 151 jfloat min_scaling_span, |
| 152 jfloat min_scaling_touch_major) { | 152 jfloat min_scaling_touch_major) { |
| 153 g_view_configuration.Get().SynchronizedUpdate( | 153 g_view_configuration.Get().SynchronizedUpdate( |
| 154 maximum_fling_velocity, minimum_fling_velocity, touch_slop, | 154 maximum_fling_velocity, minimum_fling_velocity, touch_slop, |
| 155 double_tap_slop, min_scaling_span, min_scaling_touch_major); | 155 double_tap_slop, min_scaling_span, min_scaling_touch_major); |
| 156 } | 156 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 int ViewConfiguration::GetMinScalingTouchMajorInDips() { | 194 int ViewConfiguration::GetMinScalingTouchMajorInDips() { |
| 195 return g_view_configuration.Get().min_scaling_touch_major_in_dips(); | 195 return g_view_configuration.Get().min_scaling_touch_major_in_dips(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { | 198 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { |
| 199 return RegisterNativesImpl(env); | 199 return RegisterNativesImpl(env); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace gfx | 202 } // namespace gfx |
| OLD | NEW |