Loading core/java/android/webkit/WebSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ public class WebSettings { public void setDefaultZoom(ZoomDensity zoom) { if (mDefaultZoom != zoom) { mDefaultZoom = zoom; mWebView.updateDefaultZoomDensity(zoom.value); mWebView.adjustDefaultZoomDensity(zoom.value); } } Loading core/java/android/webkit/WebView.java +8 −2 Original line number Diff line number Diff line Loading @@ -1341,9 +1341,13 @@ public class WebView extends AbsoluteLayout } } /* package */void updateDefaultZoomDensity(int zoomDensity) { /* package */ void adjustDefaultZoomDensity(int zoomDensity) { final float density = mContext.getResources().getDisplayMetrics().density * 100 / zoomDensity; updateDefaultZoomDensity(density); } /* package */ void updateDefaultZoomDensity(float density) { mNavSlop = (int) (16 * density); mZoomManager.updateDefaultZoomDensity(density); } Loading Loading @@ -2469,7 +2473,9 @@ public class WebView extends AbsoluteLayout * Set the initial scale for the WebView. 0 means default. If * {@link WebSettings#getUseWideViewPort()} is true, it zooms out all the * way. Otherwise it starts with 100%. If initial scale is greater than 0, * WebView starts will this value as initial scale. * WebView starts with this value as initial scale. * Please note that unlike the scale properties in the viewport meta tag, * this method doesn't take the screen density into account. * * @param scaleInPercent The initial scale in percent. */ Loading core/java/android/webkit/WebViewCore.java +4 −1 Original line number Diff line number Diff line Loading @@ -2336,6 +2336,9 @@ public final class WebViewCore { adjust = (float) mContext.getResources().getDisplayMetrics().densityDpi / mViewportDensityDpi; } if (adjust != mWebView.getDefaultZoomScale()) { mWebView.updateDefaultZoomDensity(adjust); } int defaultScale = (int) (adjust * 100); if (mViewportInitialScale > 0) { Loading Loading @@ -2546,7 +2549,7 @@ public final class WebViewCore { // called by JNI private void restoreScale(float scale, float textWrapScale) { if (mBrowserFrame.firstLayoutDone() == false) { mIsRestored = scale > 0; mIsRestored = true; mRestoredScale = scale; if (mSettings.getUseWideViewPort()) { mRestoredTextWrapScale = textWrapScale; Loading core/java/android/webkit/ZoomManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ class ZoomManager { } public final void setInitialScaleInPercent(int scaleInPercent) { mInitialScale = scaleInPercent * mDisplayDensity * 0.01f; mInitialScale = scaleInPercent * 0.01f; } public final float computeScaleWithLimits(float scale) { Loading Loading
core/java/android/webkit/WebSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ public class WebSettings { public void setDefaultZoom(ZoomDensity zoom) { if (mDefaultZoom != zoom) { mDefaultZoom = zoom; mWebView.updateDefaultZoomDensity(zoom.value); mWebView.adjustDefaultZoomDensity(zoom.value); } } Loading
core/java/android/webkit/WebView.java +8 −2 Original line number Diff line number Diff line Loading @@ -1341,9 +1341,13 @@ public class WebView extends AbsoluteLayout } } /* package */void updateDefaultZoomDensity(int zoomDensity) { /* package */ void adjustDefaultZoomDensity(int zoomDensity) { final float density = mContext.getResources().getDisplayMetrics().density * 100 / zoomDensity; updateDefaultZoomDensity(density); } /* package */ void updateDefaultZoomDensity(float density) { mNavSlop = (int) (16 * density); mZoomManager.updateDefaultZoomDensity(density); } Loading Loading @@ -2469,7 +2473,9 @@ public class WebView extends AbsoluteLayout * Set the initial scale for the WebView. 0 means default. If * {@link WebSettings#getUseWideViewPort()} is true, it zooms out all the * way. Otherwise it starts with 100%. If initial scale is greater than 0, * WebView starts will this value as initial scale. * WebView starts with this value as initial scale. * Please note that unlike the scale properties in the viewport meta tag, * this method doesn't take the screen density into account. * * @param scaleInPercent The initial scale in percent. */ Loading
core/java/android/webkit/WebViewCore.java +4 −1 Original line number Diff line number Diff line Loading @@ -2336,6 +2336,9 @@ public final class WebViewCore { adjust = (float) mContext.getResources().getDisplayMetrics().densityDpi / mViewportDensityDpi; } if (adjust != mWebView.getDefaultZoomScale()) { mWebView.updateDefaultZoomDensity(adjust); } int defaultScale = (int) (adjust * 100); if (mViewportInitialScale > 0) { Loading Loading @@ -2546,7 +2549,7 @@ public final class WebViewCore { // called by JNI private void restoreScale(float scale, float textWrapScale) { if (mBrowserFrame.firstLayoutDone() == false) { mIsRestored = scale > 0; mIsRestored = true; mRestoredScale = scale; if (mSettings.getUseWideViewPort()) { mRestoredTextWrapScale = textWrapScale; Loading
core/java/android/webkit/ZoomManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ class ZoomManager { } public final void setInitialScaleInPercent(int scaleInPercent) { mInitialScale = scaleInPercent * mDisplayDensity * 0.01f; mInitialScale = scaleInPercent * 0.01f; } public final float computeScaleWithLimits(float scale) { Loading