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

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

Issue 2300463002: Add observers for DIP scale change. (Closed)
Patch Set: Do not force layout during initialization. Created 4 years, 2 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/RenderCoordinates.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java b/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
index 5bcebc28c86b732dac67dbb830cd7e9c03ab5c00..ef33c64f08a1d017a9e3fcb47bdf1cafabf2b7cd 100644
--- a/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
+++ b/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
@@ -8,7 +8,6 @@ import android.content.Context;
import android.util.TypedValue;
import org.chromium.base.VisibleForTesting;
-import org.chromium.ui.base.WindowAndroid;
/**
* Cached copy of all positions and scales (CSS-to-DIP-to-physical pixels)
@@ -61,14 +60,13 @@ public class RenderCoordinates {
mContentHeightCss = contentHeightCss;
}
- void updateDeviceScaleFactorFromWindow(WindowAndroid windowAndroid) {
- mDeviceScaleFactor = windowAndroid.getDisplay().getDIPScale();
+ void setDeviceScaleFactor(float dipScale, Context context) {
boliu 2016/10/18 00:26:25 maybe should pass in WeakReference<Context> to mak
Tima Vaisburd 2016/10/19 01:15:54 Done.
+ mDeviceScaleFactor = dipScale;
// The wheel scroll factor depends on the theme in the context.
// This code assumes that the theme won't change between this call and
// getWheelScrollFactor().
- Context context = windowAndroid.getContext().get();
TypedValue outValue = new TypedValue();
// This is the same attribute used by Android Views to scale wheel
// event motion into scroll deltas.

Powered by Google App Engine
This is Rietveld 408576698