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

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

Issue 14018004: [Android] Refactor NativeView to be able to use it for AutofillDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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/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 d5c7af054e8ef4cf9f8752c91e9d6a24a3a1e353..b22434d588982794a893c98eece7152cd28decf0 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,7 +7,8 @@ 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.ViewAndroid;
+import org.chromium.ui.ViewAndroidDelegate;
import org.chromium.ui.WindowAndroid;
/**
@@ -18,17 +19,17 @@ public class AutofillPopupGlue implements AutofillPopupDelegate{
private final int mNativeAutofillPopup;
private final AutofillPopup mAutofillPopup;
- public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid nativeWindow,
- ContainerViewDelegate containerViewDelegate) {
+ public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid windowAndroid,
+ ViewAndroidDelegate containerViewDelegate) {
mNativeAutofillPopup = nativeAutofillPopupViewAndroid;
- mAutofillPopup = new AutofillPopup(nativeWindow.getContext(), containerViewDelegate, this);
+ mAutofillPopup = new AutofillPopup(windowAndroid.getContext(), containerViewDelegate, this);
}
@CalledByNative
private static AutofillPopupGlue create(int nativeAutofillPopupViewAndroid,
- WindowAndroid 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);

Powered by Google App Engine
This is Rietveld 408576698