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

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

Issue 2745803003: autofill-try
Patch Set: before I leave Created 3 years, 9 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/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index a09d4db3647d76e07bafb77702599547e5a71379..53fb1c4217622ff38dac5cea6ab3bdaa96fc24fe 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -28,6 +28,7 @@ import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
+import android.util.SparseArray;
import android.view.DragEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -37,6 +38,7 @@ import android.view.ViewStructure;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeProvider;
+import android.view.autofill.AutofillValue;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
@@ -84,6 +86,7 @@ import java.lang.annotation.Annotation;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.WeakHashMap;
@@ -242,6 +245,11 @@ public class AwContents implements SmartClipProvider {
AwScrollOffsetManager.Delegate delegate) {
return new AwScrollOffsetManager(delegate);
}
+
+ public AwAutofillManager createAwAutofillManager(Context context, AwContents awContents) {
+ // Remove the AwContents parameter.
+ return new DummyAwAutofillManager(context, awContents);
+ }
}
/**
@@ -359,6 +367,8 @@ public class AwContents implements SmartClipProvider {
// Do not use directly, call isNoOperation() instead.
private boolean mIsNoOperation;
+ private AwAutofillProvider mAwAutofillProvider;
+
private static String sCurrentLocales = "";
private static final class AwContentsDestroyRunnable implements Runnable {
@@ -741,6 +751,12 @@ public class AwContents implements SmartClipProvider {
mHandler = new Handler();
mContext = context;
+ AwAutofillManager awAutofillManager = dependencyFactory.createAwAutofillManager(context,
+ this);
+ if (awAutofillManager != null) {
+ mAwAutofillProvider = new AwAutofillProvider(context, mContainerView,
+ awAutofillManager);
+ }
mAppTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
mInternalAccessAdapter = internalAccessAdapter;
mNativeDrawGLFunctorFactory = nativeDrawGLFunctorFactory;
@@ -2329,6 +2345,14 @@ public class AwContents implements SmartClipProvider {
mContentViewCore.onProvideVirtualStructure(structure, true);
}
+ public void onProvideAutoFillVirtualStructure(ViewStructure structure, int flags) {
+ mAwAutofillProvider.onProvideAutoFillVirtualStructure(structure, flags);
+ }
+
+ public void autofill(final SparseArray<AutofillValue> values) {
+ mAwAutofillProvider.autofill(values);
+ }
+
public boolean isSelectActionModeAllowed(int actionModeItem) {
return (mSettings.getDisabledActionModeMenuItems() & actionModeItem) != actionModeItem;
}
@@ -2882,6 +2906,12 @@ public class AwContents implements SmartClipProvider {
}
@CalledByNative
+ private long getNativeAutofillAndroid() {
+ if (mAwAutofillProvider == null) return 0;
+ return mAwAutofillProvider.getNativeAutofillProviderAndroid();
+ }
+
+ @CalledByNative
private void didOverscroll(int deltaX, int deltaY, float velocityX, float velocityY) {
mScrollOffsetManager.overScrollBy(deltaX, deltaY);

Powered by Google App Engine
This is Rietveld 408576698