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.content.Context; | 7 import android.content.Context; |
8 import android.content.SharedPreferences; | 8 import android.content.SharedPreferences; |
9 | 9 |
10 import org.chromium.base.ContextUtils; | 10 import org.chromium.base.ContextUtils; |
(...skipping 27 matching lines...) Expand all Loading... |
38 static final String PREF_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable
_zoom"; | 38 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"; | 39 static final String PREF_USER_FONT_SCALE_FACTOR = "user_font_scale_factor"; |
40 | 40 |
41 private static FontSizePrefs sFontSizePrefs; | 41 private static FontSizePrefs sFontSizePrefs; |
42 | 42 |
43 private final long mFontSizePrefsAndroidPtr; | 43 private final long mFontSizePrefsAndroidPtr; |
44 private final Context mApplicationContext; | 44 private final Context mApplicationContext; |
45 private final SharedPreferences mSharedPreferences; | 45 private final SharedPreferences mSharedPreferences; |
46 private final ObserverList<FontSizePrefsObserver> mObserverList; | 46 private final ObserverList<FontSizePrefsObserver> mObserverList; |
47 | 47 |
48 private Float mSystemFontScaleForTests = null; | 48 private Float mSystemFontScaleForTests; |
49 | 49 |
50 /** | 50 /** |
51 * Interface for observing changes in font size-related preferences. | 51 * Interface for observing changes in font size-related preferences. |
52 */ | 52 */ |
53 public interface FontSizePrefsObserver { | 53 public interface FontSizePrefsObserver { |
54 void onFontScaleFactorChanged(float fontScaleFactor, float userFontScale
Factor); | 54 void onFontScaleFactorChanged(float fontScaleFactor, float userFontScale
Factor); |
55 void onForceEnableZoomChanged(boolean enabled); | 55 void onForceEnableZoomChanged(boolean enabled); |
56 } | 56 } |
57 | 57 |
58 private FontSizePrefs(Context context) { | 58 private FontSizePrefs(Context context) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 private native long nativeInit(); | 219 private native long nativeInit(); |
220 private native void nativeSetFontScaleFactor(long nativeFontSizePrefsAndroid
, | 220 private native void nativeSetFontScaleFactor(long nativeFontSizePrefsAndroid
, |
221 float fontScaleFactor); | 221 float fontScaleFactor); |
222 private native float nativeGetFontScaleFactor(long nativeFontSizePrefsAndroi
d); | 222 private native float nativeGetFontScaleFactor(long nativeFontSizePrefsAndroi
d); |
223 private native boolean nativeGetForceEnableZoom(long nativeFontSizePrefsAndr
oid); | 223 private native boolean nativeGetForceEnableZoom(long nativeFontSizePrefsAndr
oid); |
224 private native void nativeSetForceEnableZoom(long nativeFontSizePrefsAndroid
, boolean enabled); | 224 private native void nativeSetForceEnableZoom(long nativeFontSizePrefsAndroid
, boolean enabled); |
225 } | 225 } |
OLD | NEW |