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

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

Issue 2839023003: WebView autofill implementation (Closed)
Patch Set: Created 3 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: 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 9ebbb5b57ef8576cac1111b73192d98c93ad29ca..78b589a7d69d9b17ae72c6c1082ede502f9caaee 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -30,6 +30,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;
@@ -57,6 +58,7 @@ import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.components.autofill.AutofillProvider;
import org.chromium.components.navigation_interception.InterceptNavigationDelegate;
import org.chromium.components.navigation_interception.NavigationParams;
import org.chromium.content.browser.AppWebMessagePort;
@@ -245,6 +247,10 @@ public class AwContents implements SmartClipProvider {
AwScrollOffsetManager.Delegate delegate) {
return new AwScrollOffsetManager(delegate);
}
+
+ public AutofillProvider createAutofillProvider(Context context, ViewGroup containerView) {
+ return null;
+ }
}
/**
@@ -362,6 +368,8 @@ public class AwContents implements SmartClipProvider {
// Do not use directly, call isNoOperation() instead.
private boolean mIsNoOperation;
+ private AutofillProvider mAutofillProvider;
+
private static String sCurrentLocales = "";
private Paint mPaintForNWorkaround;
@@ -751,6 +759,7 @@ public class AwContents implements SmartClipProvider {
mHandler = new Handler();
mContext = context;
+ mAutofillProvider = dependencyFactory.createAutofillProvider(context, mContainerView);
mAppTargetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
mInternalAccessAdapter = internalAccessAdapter;
mNativeDrawGLFunctorFactory = nativeDrawGLFunctorFactory;
@@ -2339,6 +2348,14 @@ public class AwContents implements SmartClipProvider {
mContentViewCore.onProvideVirtualStructure(structure, true);
}
+ public void onProvideAutoFillVirtualStructure(ViewStructure structure, int flags) {
+ mAutofillProvider.onProvideAutoFillVirtualStructure(structure, flags);
+ }
+
+ public void autofill(final SparseArray<String> values) {
+ mAutofillProvider.autofill(values);
+ }
+
public boolean isSelectActionModeAllowed(int actionModeItem) {
return (mSettings.getDisabledActionModeMenuItems() & actionModeItem) != actionModeItem;
}
@@ -2892,6 +2909,12 @@ public class AwContents implements SmartClipProvider {
}
@CalledByNative
+ private long getNativeAutofillAndroid() {
+ if (mAutofillProvider == null) return 0;
+ return mAutofillProvider.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