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

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

Issue 23441023: Scale the autofill popup width correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 601824c8d5c9d707f15153fe7ebcdcfcdffea92c..24a9b04f726ceb5e737de22771573574bdd9ce73 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
@@ -519,9 +519,9 @@ import java.util.Map;
// The anchor view should not go outside the bounds of the ContainerView.
int leftMargin = Math.round(x * scale);
int topMargin = Math.round(mRenderCoordinates.getContentOffsetYPix() + y * scale);
+ int scaledWidth = Math.round(width * scale);
// ContentViewCore currently only supports these two container view types.
if (mContainerView instanceof FrameLayout) {
- int scaledWidth = Math.round(width * scale);
if (scaledWidth + leftMargin > mContainerView.getWidth()) {
scaledWidth = mContainerView.getWidth() - leftMargin;
}
@@ -538,9 +538,10 @@ import java.util.Map;
// these models.
leftMargin += mRenderCoordinates.getScrollXPixInt();
topMargin += mRenderCoordinates.getScrollYPixInt();
+
android.widget.AbsoluteLayout.LayoutParams lp =
- new android.widget.AbsoluteLayout.LayoutParams((int)width,
- (int)(height * scale), leftMargin, topMargin);
+ new android.widget.AbsoluteLayout.LayoutParams(
+ scaledWidth, (int)(height * scale), leftMargin, topMargin);
view.setLayoutParams(lp);
} else {
Log.e(TAG, "Unknown layout " + mContainerView.getClass().getName());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698