| Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java
|
| index 34dca60c8e769915eedab1e453bc99d5a119ff41..1d83de26ff7e48ed5786b0161e1afb7d1561e4ce 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java
|
| @@ -7,8 +7,9 @@ package org.chromium.chrome.browser.autofill;
|
| import org.chromium.base.CalledByNative;
|
| import org.chromium.base.JNINamespace;
|
| import org.chromium.chrome.browser.autofill.AutofillPopup.AutofillPopupDelegate;
|
| -import org.chromium.content.browser.ContainerViewDelegate;
|
| -import org.chromium.ui.gfx.NativeWindow;
|
| +import org.chromium.ui.ViewAndroidDelegate;
|
| +import org.chromium.ui.ViewAndroid;
|
| +import org.chromium.ui.gfx.WindowAndroid;
|
|
|
| /**
|
| * JNI call glue for AutofillExternalDelagate C++ and Java objects.
|
| @@ -18,17 +19,17 @@ public class AutofillPopupGlue implements AutofillPopupDelegate{
|
| private final int mNativeAutofillPopup;
|
| private final AutofillPopup mAutofillPopup;
|
|
|
| - public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, NativeWindow nativeWindow,
|
| - ContainerViewDelegate containerViewDelegate) {
|
| + public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid windowAndroid,
|
| + ViewAndroidDelegate containerViewDelegate) {
|
| mNativeAutofillPopup = nativeAutofillPopupViewAndroid;
|
| - mAutofillPopup = new AutofillPopup(nativeWindow, containerViewDelegate, this);
|
| + mAutofillPopup = new AutofillPopup(windowAndroid, containerViewDelegate, this);
|
| }
|
|
|
| @CalledByNative
|
| private static AutofillPopupGlue create(int nativeAutofillPopupViewAndroid,
|
| - NativeWindow nativeWindow, ContainerViewDelegate containerViewDelegate) {
|
| - return new AutofillPopupGlue(nativeAutofillPopupViewAndroid, nativeWindow,
|
| - containerViewDelegate);
|
| + WindowAndroid windowAndroid, ViewAndroid viewAndroid) {
|
| + return new AutofillPopupGlue(nativeAutofillPopupViewAndroid, windowAndroid,
|
| + viewAndroid.getViewAndroidDelegate());
|
| }
|
|
|
| @Override
|
| @@ -70,17 +71,24 @@ public class AutofillPopupGlue implements AutofillPopupDelegate{
|
| mAutofillPopup.setAnchorRect(x, y, width, height);
|
| }
|
|
|
| + // Helper methods for AutofillSuggestion
|
| +
|
| + @CalledByNative
|
| + private static AutofillSuggestion[] createAutofillSuggestionArray(int size) {
|
| + return new AutofillSuggestion[size];
|
| + }
|
| +
|
| /**
|
| - * Creates an Autofill Suggestion object with specified name and label.
|
| + * @param array AutofillSuggestion array that should get a new suggestion added.
|
| + * @param index Index in the array where to place a new suggestion.
|
| * @param name Name of the suggestion.
|
| * @param label Label of the suggestion.
|
| * @param uniqueId Unique suggestion id.
|
| - * @return The AutofillSuggestion object with the specified data.
|
| */
|
| @CalledByNative
|
| - private static AutofillSuggestion createAutofillSuggestion(String name, String label,
|
| - int uniqueId) {
|
| - return new AutofillSuggestion(name, label, uniqueId);
|
| + private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index,
|
| + String name, String label, int uniqueId) {
|
| + array[index] = new AutofillSuggestion(name, label, uniqueId);
|
| }
|
|
|
| private native void nativeRequestHide(int nativeAutofillPopupViewAndroid);
|
|
|