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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 DISALLOW_COPY_AND_ASSIGN(ViewConfigurationData); | 141 DISALLOW_COPY_AND_ASSIGN(ViewConfigurationData); |
142 }; | 142 }; |
143 | 143 |
144 // Leaky to allow access from any thread. | 144 // Leaky to allow access from any thread. |
145 base::LazyInstance<ViewConfigurationData>::Leaky g_view_configuration = | 145 base::LazyInstance<ViewConfigurationData>::Leaky g_view_configuration = |
146 LAZY_INSTANCE_INITIALIZER; | 146 LAZY_INSTANCE_INITIALIZER; |
147 | 147 |
148 } // namespace | 148 } // namespace |
149 | 149 |
150 static void UpdateSharedViewConfiguration(JNIEnv* env, | 150 static void UpdateSharedViewConfiguration(JNIEnv* env, |
151 jobject obj, | 151 const JavaParamRef<jobject>& obj, |
152 jint scaled_maximum_fling_velocity, | 152 jint scaled_maximum_fling_velocity, |
153 jint scaled_minimum_fling_velocity, | 153 jint scaled_minimum_fling_velocity, |
154 jint scaled_touch_slop, | 154 jint scaled_touch_slop, |
155 jint scaled_double_tap_slop, | 155 jint scaled_double_tap_slop, |
156 jint scaled_min_scaling_span, | 156 jint scaled_min_scaling_span, |
157 jint scaled_min_scaling_touch_major) { | 157 jint scaled_min_scaling_touch_major) { |
158 g_view_configuration.Get().SynchronizedUpdate(scaled_maximum_fling_velocity, | 158 g_view_configuration.Get().SynchronizedUpdate(scaled_maximum_fling_velocity, |
159 scaled_minimum_fling_velocity, | 159 scaled_minimum_fling_velocity, |
160 scaled_touch_slop, | 160 scaled_touch_slop, |
161 scaled_double_tap_slop, | 161 scaled_double_tap_slop, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 int ViewConfiguration::GetMinScalingTouchMajorInPixels() { | 202 int ViewConfiguration::GetMinScalingTouchMajorInPixels() { |
203 return g_view_configuration.Get().min_scaling_touch_major_in_pixels(); | 203 return g_view_configuration.Get().min_scaling_touch_major_in_pixels(); |
204 } | 204 } |
205 | 205 |
206 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { | 206 bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) { |
207 return RegisterNativesImpl(env); | 207 return RegisterNativesImpl(env); |
208 } | 208 } |
209 | 209 |
210 } // namespace gfx | 210 } // namespace gfx |
OLD | NEW |