Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1185)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 2202123002: Make WebView respond to device scale change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made WindowAndroid::content_offset() device scale independent, restored AwContents.onSizeChanged(),… Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ec613ea349f678a3136d0c25b83da3892a9e7f5f..3552f5018c474cb3d42affa930ecd481cbc9ea1c 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
@@ -920,6 +920,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
@@ -3278,6 +3287,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);

Powered by Google App Engine
This is Rietveld 408576698