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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java

Issue 2103243002: Factor out ContentViewAndroidDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScopedAnchorView 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: android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java b/android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java
index 172c2b384f03a6bb2115075cda180d040e5b34fb..2c7e3bc73efc31d5e531675d98aeaa91e5d28036 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwAutofillClient.java
@@ -4,6 +4,7 @@
package org.chromium.android_webview;
+import android.view.View;
import android.view.ViewGroup;
import org.chromium.base.annotations.CalledByNative;
@@ -41,18 +42,21 @@ public class AwAutofillClient {
}
@CalledByNative
- private void showAutofillPopup(float x, float y, float width, float height,
- boolean isRtl, AutofillSuggestion[] suggestions) {
+ private void showAutofillPopup(View anchorView, float width, boolean isRtl,
+ AutofillSuggestion[] suggestions) {
if (mContentViewCore == null) return;
if (mAutofillPopup == null) {
mAutofillPopup = new AutofillPopup(
mContentViewCore.getContext(),
- mContentViewCore.getViewAndroidDelegate(),
+ anchorView,
+ width,
new AutofillDelegate() {
@Override
- public void dismissed() { }
+ public void dismissed() {
+ nativeDismissed(mNativeAwAutofillClient);
+ }
@Override
public void suggestionSelected(int listIndex) {
nativeSuggestionSelected(mNativeAwAutofillClient, listIndex);
@@ -61,7 +65,6 @@ public class AwAutofillClient {
public void deleteSuggestion(int listIndex) { }
});
}
- mAutofillPopup.setAnchorRect(x, y, width, height);
mAutofillPopup.filterAndShow(suggestions, isRtl);
}
@@ -91,6 +94,7 @@ public class AwAutofillClient {
new AutofillSuggestion(name, label, DropdownItem.NO_ICON, uniqueId, false, false);
}
+ private native void nativeDismissed(long nativeAwAutofillClient);
private native void nativeSuggestionSelected(long nativeAwAutofillClient,
int position);
}

Powered by Google App Engine
This is Rietveld 408576698