| Index: components/autofill/android/java/src/org/chromium/components/autofill/AutofillProvider.java
|
| diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProvider.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProvider.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..16dc39e7a7f6e14eb88d96fe4425a480cbed2a96
|
| --- /dev/null
|
| +++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProvider.java
|
| @@ -0,0 +1,52 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.components.autofill;
|
| +
|
| +import org.chromium.base.annotations.CalledByNative;
|
| +import org.chromium.base.annotations.JNINamespace;
|
| +
|
| +@JNINamespace("autofill")
|
| +public abstract class AutofillProvider {
|
| +
|
| + private long mNativeAutofillProviderAndroid;
|
| +
|
| + public AutofillProvider() {
|
| + }
|
| +
|
| + public long getNativeAutofillProviderAndroid() {
|
| + if (mNativeAutofillProviderAndroid == 0) {
|
| + mNativeAutofillProviderAndroid = nativeCreateNativePeer();
|
| + }
|
| + return mNativeAutofillProviderAndroid;
|
| + }
|
| +
|
| + public void autofill(FormData formData) {
|
| + nativeOnAutofillAvailable(mNativeAutofillProviderAndroid, formData);
|
| + }
|
| +
|
| + @CalledByNative
|
| + protected abstract void queryFormFieldAutofill(FormData formData, int focus, int x, int y,
|
| + int width, int height);
|
| +
|
| + @CalledByNative
|
| + protected abstract void onTextFieldDidChange(int index);
|
| +
|
| + @CalledByNative
|
| + protected abstract void OnWillSubmitForm();
|
| +
|
| + @CalledByNative
|
| + protected abstract void OnFocusChanged(boolean focusOnForm, int focusItem, int x, int y,
|
| + int width, int height);
|
| +
|
| + @CalledByNative
|
| + private void OnNativeDestroyed() {
|
| + mNativeAutofillProviderAndroid = 0;
|
| + }
|
| +
|
| + private native long nativeCreateNativePeer();
|
| +
|
| + private native void nativeOnAutofillAvailable(long nativeAutofillProviderAndroid,
|
| + FormData formData);
|
| +}
|
|
|