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

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

Issue 2103243002: Factor out ContentViewAndroidDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Comments Created 4 years, 5 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/AutofillPopupBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
index 77b490b5ec7e843adba45b1fe006e8b8313c002c..befcd12e6232a4f620224dd90594bd89c4df9216 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java
@@ -9,6 +9,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
+import android.view.View;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -18,7 +19,6 @@ import org.chromium.ui.DropdownItem;
import org.chromium.ui.autofill.AutofillDelegate;
import org.chromium.ui.autofill.AutofillPopup;
import org.chromium.ui.autofill.AutofillSuggestion;
-import org.chromium.ui.base.ViewAndroidDelegate;
import org.chromium.ui.base.WindowAndroid;
/**
@@ -31,8 +31,8 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On
private AlertDialog mDeletionDialog;
private final Context mContext;
- public AutofillPopupBridge(long nativeAutofillPopupViewAndroid, WindowAndroid windowAndroid,
- ViewAndroidDelegate containerViewDelegate) {
+ public AutofillPopupBridge(View anchorView, float anchorWidth,
+ long nativeAutofillPopupViewAndroid, WindowAndroid windowAndroid) {
mNativeAutofillPopup = nativeAutofillPopupViewAndroid;
Activity activity = windowAndroid.getActivity().get();
if (activity == null) {
@@ -47,16 +47,16 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On
}
});
} else {
- mAutofillPopup = new AutofillPopup(activity, containerViewDelegate, this);
+ mAutofillPopup = new AutofillPopup(activity, anchorView, anchorWidth, this);
mContext = activity;
}
}
@CalledByNative
- private static AutofillPopupBridge create(long nativeAutofillPopupViewAndroid,
- WindowAndroid windowAndroid, ViewAndroidDelegate viewAndroidDelegate) {
- return new AutofillPopupBridge(
- nativeAutofillPopupViewAndroid, windowAndroid, viewAndroidDelegate);
+ private static AutofillPopupBridge create(View anchorView, float anchorWidth,
+ long nativeAutofillPopupViewAndroid, WindowAndroid windowAndroid) {
+ return new AutofillPopupBridge(anchorView, anchorWidth, nativeAutofillPopupViewAndroid,
+ windowAndroid);
}
@Override
@@ -98,18 +98,6 @@ public class AutofillPopupBridge implements AutofillDelegate, DialogInterface.On
if (mAutofillPopup != null) mAutofillPopup.filterAndShow(suggestions, isRtl);
}
- /**
- * Sets the location and size of the Autofill popup anchor (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) {
- if (mAutofillPopup != null) mAutofillPopup.setAnchorRect(x, y, width, height);
- }
-
@CalledByNative
private void confirmDeletion(String title, String body) {
mDeletionDialog = new AlertDialog.Builder(mContext, R.style.AlertDialogTheme)

Powered by Google App Engine
This is Rietveld 408576698