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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java

Issue 12188020: Adding the page and DPI scale adjustment for Autofill Popups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
index 7fed2994b132c2275c269920b677ab6e7c855108..efc9bb7774d647d591ce0bbc2934dbfdbb2e69b9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import org.chromium.chrome.R;
import org.chromium.content.browser.ContainerViewDelegate;
+import org.chromium.ui.gfx.DeviceDisplayInfo;
import org.chromium.ui.gfx.NativeWindow;
/**
@@ -150,7 +151,9 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem
* @param height The height of the anchor view.
*/
public void setAnchorRect(float x, float y, float width, float height) {
- mAnchorRect = new Rect((int) x, (int) y, (int) (x + width), (int) (y + height));
+ Double scale = DeviceDisplayInfo.create(mNativeWindow.getContext()).getDIPScale();
+ mAnchorRect = new Rect((int) Math.round(x * scale), (int) Math.round(y * scale),
Ilya Sherman 2013/02/04 23:23:28 nit: Do you still need the type casts to int now t
aurimas (slooooooooow) 2013/02/04 23:56:27 It was returning a long since the input was Double
+ (int) Math.round((x + width) * scale), (int) Math.round((y + height) * scale));
}
/**

Powered by Google App Engine
This is Rietveld 408576698