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 package org.chromium.chrome.browser.accessibility; | 5 package org.chromium.chrome.browser.accessibility; |
6 | 6 |
| 7 import android.annotation.SuppressLint; |
7 import android.content.Context; | 8 import android.content.Context; |
8 import android.content.SharedPreferences; | 9 import android.content.SharedPreferences; |
9 | 10 |
10 import org.chromium.base.ContextUtils; | 11 import org.chromium.base.ContextUtils; |
11 import org.chromium.base.ObserverList; | 12 import org.chromium.base.ObserverList; |
12 import org.chromium.base.ThreadUtils; | 13 import org.chromium.base.ThreadUtils; |
13 import org.chromium.base.VisibleForTesting; | 14 import org.chromium.base.VisibleForTesting; |
14 import org.chromium.base.annotations.CalledByNative; | 15 import org.chromium.base.annotations.CalledByNative; |
15 import org.chromium.chrome.browser.util.MathUtils; | 16 import org.chromium.chrome.browser.util.MathUtils; |
16 | 17 |
(...skipping 14 matching lines...) Expand all Loading... |
31 * setting is on (i.e. this value should be the same as or lesser than the f
ont size scale used | 32 * setting is on (i.e. this value should be the same as or lesser than the f
ont size scale used |
32 * by accessiblity large text). | 33 * by accessiblity large text). |
33 */ | 34 */ |
34 public static final float FORCE_ENABLE_ZOOM_THRESHOLD_MULTIPLIER = 1.3f; | 35 public static final float FORCE_ENABLE_ZOOM_THRESHOLD_MULTIPLIER = 1.3f; |
35 | 36 |
36 private static final float EPSILON = 0.001f; | 37 private static final float EPSILON = 0.001f; |
37 | 38 |
38 static final String PREF_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable
_zoom"; | 39 static final String PREF_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable
_zoom"; |
39 static final String PREF_USER_FONT_SCALE_FACTOR = "user_font_scale_factor"; | 40 static final String PREF_USER_FONT_SCALE_FACTOR = "user_font_scale_factor"; |
40 | 41 |
| 42 @SuppressLint("StaticFieldLeak") |
41 private static FontSizePrefs sFontSizePrefs; | 43 private static FontSizePrefs sFontSizePrefs; |
42 | 44 |
43 private final long mFontSizePrefsAndroidPtr; | 45 private final long mFontSizePrefsAndroidPtr; |
44 private final Context mApplicationContext; | 46 private final Context mApplicationContext; |
45 private final SharedPreferences mSharedPreferences; | 47 private final SharedPreferences mSharedPreferences; |
46 private final ObserverList<FontSizePrefsObserver> mObserverList; | 48 private final ObserverList<FontSizePrefsObserver> mObserverList; |
47 | 49 |
48 private Float mSystemFontScaleForTests; | 50 private Float mSystemFontScaleForTests; |
49 | 51 |
50 /** | 52 /** |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 218 } |
217 } | 219 } |
218 | 220 |
219 private native long nativeInit(); | 221 private native long nativeInit(); |
220 private native void nativeSetFontScaleFactor(long nativeFontSizePrefsAndroid
, | 222 private native void nativeSetFontScaleFactor(long nativeFontSizePrefsAndroid
, |
221 float fontScaleFactor); | 223 float fontScaleFactor); |
222 private native float nativeGetFontScaleFactor(long nativeFontSizePrefsAndroi
d); | 224 private native float nativeGetFontScaleFactor(long nativeFontSizePrefsAndroi
d); |
223 private native boolean nativeGetForceEnableZoom(long nativeFontSizePrefsAndr
oid); | 225 private native boolean nativeGetForceEnableZoom(long nativeFontSizePrefsAndr
oid); |
224 private native void nativeSetForceEnableZoom(long nativeFontSizePrefsAndroid
, boolean enabled); | 226 private native void nativeSetForceEnableZoom(long nativeFontSizePrefsAndroid
, boolean enabled); |
225 } | 227 } |
OLD | NEW |