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

Unified Diff: components/autofill/android/java/src/org/chromium/components/autofill/AutofillProvider.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: 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);
+}

Powered by Google App Engine
This is Rietveld 408576698