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

Unified Diff: components/autofill/content/browser/autofill_provider_android.h

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/content/browser/autofill_provider_android.h
diff --git a/components/autofill/content/browser/autofill_provider_android.h b/components/autofill/content/browser/autofill_provider_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..a2e22ca4f8efbfd76647b6a32dd86a9e288cdce2
--- /dev/null
+++ b/components/autofill/content/browser/autofill_provider_android.h
@@ -0,0 +1,68 @@
+// 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.
+
+#ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "components/autofill/content/browser/autofill_provider.h"
+
+namespace autofill {
+
+class FormDataAndroid;
+
+class AutofillProviderAndroid : public AutofillProvider {
+ public:
+ AutofillProviderAndroid(const base::android::JavaParamRef<jobject>& jcaller);
+ virtual ~AutofillProviderAndroid();
+
+ // Override AutofillProvider methods
+ void OnQueryFormFieldAutofill(ContentAutofillDriver* driver,
+ int32_t id,
+ const FormData& form,
+ const FormFieldData& field,
+ const gfx::RectF& bounding_box) override;
+
+ void OnTextFieldDidChange(ContentAutofillDriver* driver,
+ const FormData& form,
+ const FormFieldData& field,
+ const base::TimeTicks& timestamp) override;
+
+ void OnWillSubmitForm(ContentAutofillDriver* driver,
+ const FormData& form,
+ const base::TimeTicks& timestamp) override;
+
+ void OnFocusNoLongerOnForm(ContentAutofillDriver* driver) override;
+
+ void OnDidFillAutofillFormData(ContentAutofillDriver* driver,
+ const FormData& form,
+ base::TimeTicks timestamp) override;
+
+ void OnContentAutofillDriverDestroyed(ContentAutofillDriver* driver) override;
+
+
+ // Methods called by Java.
+ void OnAutofillAvailable(JNIEnv*env,
+ jobject jcaller,
+ jobject formData);
+ private:
+ void OnFocusChanged(bool focus_on_form,
+ size_t index,
+ const gfx::RectF& bounding_box);
+
+ bool ValidateDriver(ContentAutofillDriver* driver);
+
+ int32_t id_;
+ std::unique_ptr<FormDataAndroid> form_;
+ JavaObjectWeakGlobalRef java_ref_;
+ ContentAutofillDriver* driver_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutofillProviderAndroid);
+};
+
+bool RegisterAutofillProvider(JNIEnv* env);
+
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698