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

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

Issue 15660018: [autofill] Add support for PSL domain matching for password autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments from palmer Created 7 years, 6 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 28b151dbb961b6f83dded829e6777e9e0cc46f49..e1b8395a6c448eeb42154fab10bf7799bd338dbb 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
@@ -45,8 +45,8 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem
private float mAnchorHeight;
private float mAnchorX;
private float mAnchorY;
- private Paint mNameViewPaint;
private Paint mLabelViewPaint;
+ private Paint mSublabelViewPaint;
private OnLayoutChangeListener mLayoutChangeListener;
/**
@@ -159,14 +159,14 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem
* @return The popup window width in DIP.
*/
private float getDesiredWidth(AutofillSuggestion[] data) {
- if (mNameViewPaint == null || mLabelViewPaint == null) {
+ if (mLabelViewPaint == null || mSublabelViewPaint == null) {
LayoutInflater inflater =
(LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.autofill_text, null);
- TextView nameView = (TextView) layout.findViewById(R.id.autofill_name);
- mNameViewPaint = nameView.getPaint();
TextView labelView = (TextView) layout.findViewById(R.id.autofill_label);
mLabelViewPaint = labelView.getPaint();
+ TextView sublabelView = (TextView) layout.findViewById(R.id.autofill_sublabel);
+ mSublabelViewPaint = sublabelView.getPaint();
}
float maxTextWidth = 0;
@@ -175,12 +175,12 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem
bounds.setEmpty();
String name = data[i].mName;
float width = 0;
- mNameViewPaint.getTextBounds(name, 0, name.length(), bounds);
+ mLabelViewPaint.getTextBounds(name, 0, name.length(), bounds);
width += bounds.width();
bounds.setEmpty();
String label = data[i].mLabel;
- mLabelViewPaint.getTextBounds(label, 0, label.length(), bounds);
+ mSublabelViewPaint.getTextBounds(label, 0, label.length(), bounds);
width += bounds.width();
maxTextWidth = Math.max(width, maxTextWidth);
}

Powered by Google App Engine
This is Rietveld 408576698