Index: android_webview/java/src/org/chromium/android_webview/AwSettings.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java |
index 928c73e04a9e94c2fda82c4f266feaa4d5193543..9c8f3b451014cfbcf3a873da96f2c9b0a0067ab5 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java |
@@ -88,9 +88,6 @@ public class AwSettings { |
private final boolean mPasswordEchoEnabled; |
- // Font scale factor determined by Android system setting. |
- private final float mFontScale; |
- |
// Not accessed by the native side. |
private boolean mBlockNetworkLoads; // Default depends on permission of embedding APK. |
private boolean mAllowContentUrlAccess = true; |
@@ -223,8 +220,10 @@ public class AwSettings { |
// Respect the system setting for password echoing. |
mPasswordEchoEnabled = Settings.System.getInt(context.getContentResolver(), |
Settings.System.TEXT_SHOW_PASSWORD, 1) == 1; |
- mFontScale = context.getResources().getConfiguration().fontScale; |
- mTextSizePercent *= mFontScale; |
+ |
+ // By default, scale the text size by the system font scale factor. Embedders |
+ // may override this by invoking setTextZoom(). |
+ mTextSizePercent *= context.getResources().getConfiguration().fontScale; |
mSupportLegacyQuirks = supportsLegacyQuirks; |
} |
@@ -561,9 +560,8 @@ public class AwSettings { |
*/ |
public void setTextZoom(final int textZoom) { |
synchronized (mAwSettingsLock) { |
- int scaledTextZoomPercent = (int)(textZoom * mFontScale); |
- if (mTextSizePercent != scaledTextZoomPercent) { |
- mTextSizePercent = scaledTextZoomPercent; |
+ if (mTextSizePercent != textZoom) { |
+ mTextSizePercent = textZoom; |
mEventHandler.updateWebkitPreferencesLocked(); |
} |
} |