| Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| index a3dbd95e3576653464aabdc50a83f32b418d5df6..d9349d576e73d741d415f3282cd4f51f6be2fcad 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| @@ -300,7 +300,7 @@ public class AwContents implements SmartClipProvider,
|
| private Bitmap mFavicon;
|
| private boolean mHasRequestedVisitedHistoryFromClient;
|
| // TODO(boliu): This should be in a global context, not per webview.
|
| - private final double mDIPScale;
|
| + private double mDIPScale;
|
| // Whether this WebView is a popup.
|
| private boolean mIsPopupWindow = false;
|
|
|
| @@ -712,6 +712,16 @@ public class AwContents implements SmartClipProvider,
|
| public void onConfigurationChanged(Configuration configuration) {
|
| setLocale(LocaleUtils.getLocale(configuration.locale));
|
| mSettings.updateAcceptLanguages();
|
| +
|
| + DeviceDisplayInfo displayInfo = DeviceDisplayInfo.create(mContext);
|
| + // Update all display related parameters.
|
| + displayInfo.updateNativeSharedDisplayInfo();
|
| +
|
| + final double newDIPScale = displayInfo.getDIPScale();
|
| + if (newDIPScale != mDIPScale) {
|
| + mContentViewCore.setDeviceScaleFactor((float) newDIPScale);
|
| + setDIPScale(newDIPScale);
|
| + }
|
| }
|
| };
|
|
|
| @@ -771,9 +781,7 @@ public class AwContents implements SmartClipProvider,
|
| mContentViewClient = new AwContentViewClient(contentsClient, settings, this, mContext);
|
| mLayoutSizer = dependencyFactory.createLayoutSizer();
|
| mSettings = settings;
|
| - mDIPScale = DeviceDisplayInfo.create(mContext).getDIPScale();
|
| mLayoutSizer.setDelegate(new AwLayoutSizerDelegate());
|
| - mLayoutSizer.setDIPScale(mDIPScale);
|
| mWebContentsDelegate = new AwWebContentsDelegateAdapter(
|
| this, contentsClient, mContentViewClient, mContext, mContainerView);
|
| mContentsClientBridge = new AwContentsClientBridge(mContext, contentsClient,
|
| @@ -804,7 +812,6 @@ public class AwContents implements SmartClipProvider,
|
| mDefaultVideoPosterRequestHandler = new DefaultVideoPosterRequestHandler(mContentsClient);
|
| mSettings.setDefaultVideoPosterURL(
|
| mDefaultVideoPosterRequestHandler.getDefaultVideoPosterURL());
|
| - mSettings.setDIPScale(mDIPScale);
|
| mScrollOffsetManager =
|
| dependencyFactory.createScrollOffsetManager(new AwScrollOffsetManagerDelegate());
|
| mScrollAccessibilityHelper = new ScrollAccessibilityHelper(mContainerView);
|
| @@ -829,6 +836,13 @@ public class AwContents implements SmartClipProvider,
|
| contentViewCore.setZoomControlsDelegate(zoomControlsDelegate);
|
| }
|
|
|
| + private void setDIPScale(double dipScale) {
|
| + mDIPScale = dipScale;
|
| + nativeSetDipScale(mNativeAwContents, (float) mDIPScale);
|
| + mSettings.setDIPScale(mDIPScale);
|
| + mLayoutSizer.setDIPScale(mDIPScale);
|
| + }
|
| +
|
| boolean isFullScreen() {
|
| return mFullScreenTransitionsState.isFullScreen();
|
| }
|
| @@ -1061,7 +1075,10 @@ public class AwContents implements SmartClipProvider,
|
| mNavigationController = mWebContents.getNavigationController();
|
| installWebContentsObserver();
|
| mSettings.setWebContents(webContents);
|
| - nativeSetDipScale(mNativeAwContents, (float) mDIPScale);
|
| +
|
| + // ContentViewCore requests and stores the device scale factor.
|
| + setDIPScale(mContentViewCore.getDeviceScaleFactor());
|
| +
|
| updateContentViewCoreVisibility();
|
|
|
| // The native side object has been bound to this java instance, so now is the time to
|
|
|