| Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java
|
| index aca6d9ba9b34624a8b2d4a4baf10c6a063613873..acfd2654b687b73743d8a7a9b1049f8adf7da49c 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java
|
| @@ -30,24 +30,30 @@ public class PasswordGenerationPopupBridge implements AdapterView.OnItemClickLis
|
|
|
| /**
|
| * A convenience method for the constructor to be invoked from the native counterpart.
|
| + * @param anchorView View anchored for popup.
|
| + * @param anchorWidth Width of the anchor view.
|
| * @param nativePopup The pointer to the native counterpart.
|
| * @param windowAndroid The browser window.
|
| * @param containerViewDelegate Interface to acquire and release anchors.
|
| */
|
| @CalledByNative
|
| - private static PasswordGenerationPopupBridge create(long nativePopup,
|
| - WindowAndroid windowAndroid, ViewAndroidDelegate viewAndroidDelegate) {
|
| - return new PasswordGenerationPopupBridge(nativePopup, windowAndroid, viewAndroidDelegate);
|
| + private static PasswordGenerationPopupBridge create(View anchorView, float anchorWidth,
|
| + long nativePopup, WindowAndroid windowAndroid,
|
| + ViewAndroidDelegate viewAndroidDelegate) {
|
| + return new PasswordGenerationPopupBridge(anchorView, anchorWidth, nativePopup,
|
| + windowAndroid, viewAndroidDelegate);
|
| }
|
|
|
| /**
|
| * Builds the bridge between native and Java objects.
|
| + * @param anchorView View anchored for popup.
|
| + * @param anchorWidth Width of the anchor view.
|
| * @param nativePopup The pointer to the native counterpart.
|
| * @param windowAndroid The browser window.
|
| * @param containerViewDelegate Interface to acquire and release anchors.
|
| */
|
| - public PasswordGenerationPopupBridge(long nativePopup, WindowAndroid windowAndroid,
|
| - ViewAndroidDelegate containerViewDelegate) {
|
| + public PasswordGenerationPopupBridge(View anchorView, float anchorWidth, long nativePopup,
|
| + WindowAndroid windowAndroid, ViewAndroidDelegate containerViewDelegate) {
|
| mNativePasswordGenerationPopupViewAndroid = nativePopup;
|
| mContext = windowAndroid.getActivity().get();
|
| // mContext could've been garbage collected.
|
| @@ -62,14 +68,15 @@ public class PasswordGenerationPopupBridge implements AdapterView.OnItemClickLis
|
| }
|
| });
|
| } else {
|
| - mPopup = new DropdownPopupWindow(mContext, containerViewDelegate);
|
| + mPopup = new DropdownPopupWindow(mContext, anchorView, anchorWidth,
|
| + containerViewDelegate);
|
| mPopup.setOnItemClickListener(this);
|
| mPopup.setOnDismissListener(this);
|
| mPopup.disableHideOnOutsideTap();
|
| mPopup.setContentDescriptionForAccessibility(
|
| mContext.getString(R.string.password_generation_popup_content_description));
|
| }
|
| - mAnchorWidth = 0;
|
| + mAnchorWidth = anchorWidth;
|
| }
|
|
|
| /**
|
| @@ -99,19 +106,6 @@ public class PasswordGenerationPopupBridge implements AdapterView.OnItemClickLis
|
| private native void nativeDismissed(long nativePasswordGenerationPopupViewAndroid);
|
|
|
| /**
|
| - * Sets the location and size of the popup anchor (password input field).
|
| - * @param x X coordinate.
|
| - * @param y Y coordinate.
|
| - * @param width The width of the anchor.
|
| - * @param height The height of the anchor.
|
| - */
|
| - @CalledByNative
|
| - private void setAnchorRect(float x, float y, float width, float height) {
|
| - mAnchorWidth = width;
|
| - if (mPopup != null) mPopup.setAnchorRect(x, y, width, height);
|
| - }
|
| -
|
| - /**
|
| * Shows a password generation popup with specified data. Should be called after
|
| * setAnchorRect().
|
| * @param isRtl True if the popup should be RTL.
|
|
|