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

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

Issue 2839023003: WebView autofill implementation (Closed)
Patch Set: fix coordinates Created 3 years, 7 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..ce093796305b4604b5facc929e22ce2c022cbd09
--- /dev/null
+++ b/components/autofill/content/browser/autofill_provider_android.h
@@ -0,0 +1,75 @@
+// 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_
sebsg 2017/05/08 15:38:17 Could you please move this file and the other _and
michaelbai 2017/05/09 00:27:03 Done.
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/memory/weak_ptr.h"
+#include "components/autofill/core/browser/autofill_provider.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace autofill {
+
+class FormDataAndroid;
+
+class AutofillProviderAndroid : public AutofillProvider {
+ public:
+ AutofillProviderAndroid(
+ const base::android::ScopedJavaLocalRef<jobject>& jcaller,
+ content::WebContents* web_contents);
+ virtual ~AutofillProviderAndroid();
+
+ void setNewWebContents();
+ // Override AutofillProvider methods
+ void OnQueryFormFieldAutofill(AutofillManager* manager,
+ int32_t id,
+ const FormData& form,
+ const FormFieldData& field,
+ const gfx::RectF& bounding_box) override;
+
+ void OnTextFieldDidChange(AutofillManager* manager,
+ const FormData& form,
+ const FormFieldData& field,
+ const base::TimeTicks& timestamp) override;
+
+ void OnWillSubmitForm(AutofillManager* manager,
+ const FormData& form,
+ const base::TimeTicks& timestamp) override;
+
+ void OnFocusNoLongerOnForm(AutofillManager* manager) override;
+
+ void OnDidFillAutofillFormData(AutofillManager* manager,
+ const FormData& form,
+ base::TimeTicks timestamp) override;
+
+ void Reset(AutofillManager* manager) 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 ValidateManager(AutofillManager* manager);
+
+ int32_t id_;
+ std::unique_ptr<FormDataAndroid> form_;
+ base::WeakPtr<AutofillManager> manager_;
+ JavaObjectWeakGlobalRef java_ref_;
+ content::WebContents* web_contents_;
+
+ 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