| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| index f7f3ccedb74ef11394aca7df48d17a9b69874e5d..f6fe34efc886356b615bb1ab660f36d28edbd970 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| @@ -955,6 +955,15 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
|
| }
|
|
|
| /**
|
| + * Sets the device scale factor (maps DIP pixels to physical pixels).
|
| + */
|
| + public void setDeviceScaleFactor(float value) {
|
| + mRenderCoordinates.setDeviceScaleFactor(value);
|
| + if (mNativeContentViewCore == 0) return;
|
| + nativeSetDeviceScaleFactor(mNativeContentViewCore, value);
|
| + }
|
| +
|
| + /**
|
| * @return Current page scale factor (maps CSS pixels to DIP pixels).
|
| */
|
| @VisibleForTesting
|
| @@ -1471,6 +1480,28 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
|
| }
|
| }
|
|
|
| + /**
|
| + * Called when the underlying surface size and the viewport size are changed
|
| + * simultaneously. This may happen in WebView.
|
| + */
|
| + public void onPhysicalAndViewportSizeChanged(int wPix, int hPix) {
|
| + if (mPhysicalBackingWidthPix == wPix && mPhysicalBackingHeightPix == hPix
|
| + && getViewportWidthPix() == wPix && getViewportHeightPix() == hPix) {
|
| + return;
|
| + }
|
| +
|
| + mPhysicalBackingWidthPix = wPix;
|
| + mPhysicalBackingHeightPix = hPix;
|
| + mViewportWidthPix = wPix;
|
| + mViewportHeightPix = hPix;
|
| +
|
| + if (mNativeContentViewCore != 0) {
|
| + nativeWasResized(mNativeContentViewCore);
|
| + }
|
| +
|
| + updateAfterSizeChanged();
|
| + }
|
| +
|
| private void updateAfterSizeChanged() {
|
| mPopupZoomer.hide(false);
|
|
|
| @@ -3321,6 +3352,8 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
|
|
|
| private native void nativeSetFocus(long nativeContentViewCoreImpl, boolean focused);
|
|
|
| + private native void nativeSetDeviceScaleFactor(long nativeContentViewCoreImpl, float value);
|
| +
|
| private native void nativeSendOrientationChangeEvent(
|
| long nativeContentViewCoreImpl, int orientation);
|
|
|
|
|