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

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 isherman and aurimas 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..cdff1b6a407e57dc8bb8aa7948e9d38cfd84bdfc 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,28 +159,28 @@ 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;
Rect bounds = new Rect();
for (int i = 0; i < data.length; ++i) {
bounds.setEmpty();
- String name = data[i].mName;
+ String label = data[i].mLabel;
float width = 0;
- mNameViewPaint.getTextBounds(name, 0, name.length(), bounds);
+ mLabelViewPaint.getTextBounds(label, 0, label.length(), bounds);
width += bounds.width();
bounds.setEmpty();
- String label = data[i].mLabel;
- mLabelViewPaint.getTextBounds(label, 0, label.length(), bounds);
+ String sublabel = data[i].mSublabel;
+ mSublabelViewPaint.getTextBounds(sublabel, 0, sublabel.length(), bounds);
width += bounds.width();
maxTextWidth = Math.max(width, maxTextWidth);
}

Powered by Google App Engine
This is Rietveld 408576698