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

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

Issue 2300463002: Add observers for DIP scale change. (Closed)
Patch Set: An attempt to fix tests compilation Created 4 years, 3 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 2df4f974938fc00b0ed8930b8fab2d0c6fdca053..367e7eeb844d001e58eec9729b48594b5d60f477 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
@@ -7,9 +7,7 @@ package org.chromium.content.browser;
import android.content.Context;
import android.util.TypedValue;
-import org.chromium.base.CommandLine;
import org.chromium.base.VisibleForTesting;
-import org.chromium.content.common.ContentSwitches;
/**
* Cached copy of all positions and scales (CSS-to-DIP-to-physical pixels)
@@ -62,13 +60,11 @@ public class RenderCoordinates {
mContentHeightCss = contentHeightCss;
}
- void setDeviceScaleFactor(Context context) {
- String forceScaleFactor =
- CommandLine.getInstance().getSwitchValue(ContentSwitches.FORCE_DEVICE_SCALE_FACTOR);
- mDeviceScaleFactor = forceScaleFactor != null
- ? Float.valueOf(forceScaleFactor)
- : context.getResources().getDisplayMetrics().density;
+ void setDeviceScaleFactor(float dipScale) {
boliu 2016/09/14 04:35:32 why separate these if you just end up calling thes
Tima Vaisburd 2016/09/15 00:05:04 Combined.
+ mDeviceScaleFactor = dipScale;
+ }
+ void setWheelScrollFactor(Context context) {
// The wheel scroll factor depends on the theme in the context.
// This code assumes that the theme won't change between this call and
// getWheelScrollScale().

Powered by Google App Engine
This is Rietveld 408576698