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

Side by Side Diff: components/autofill/android/autofill_provider_android.h

Issue 2839023003: WebView autofill implementation (Closed)
Patch Set: Refactoring AutofillManager 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUTOFILL_ANDROID_AUTOFILL_PROVIDER_ANDROID_H_
6 #define COMPONENTS_AUTOFILL_ANDROID_AUTOFILL_PROVIDER_ANDROID_H_
7
8 #include "base/android/jni_weak_ref.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/autofill/core/browser/autofill_provider.h"
11
12 namespace content {
13 class WebContents;
14 }
15
16 namespace autofill {
17
18 class FormDataAndroid;
19
20 class AutofillProviderAndroid : public AutofillProvider {
Mathieu 2017/05/24 18:02:01 Is this only used for WebView? if so, perhaps if s
Mathieu 2017/05/24 18:02:01 Can you add a class comment, detailing who owns th
michaelbai 2017/05/24 20:57:54 No, Chrome will also use this in future.
michaelbai 2017/05/26 23:12:07 Done.
Roger McFarlane (Chromium) 2017/05/31 18:33:23 More details, plz. In what capacity?
michaelbai 2017/05/31 21:05:54 I don't have detail to put, but will definitely in
21 public:
22 AutofillProviderAndroid(const base::android::JavaRef<jobject>& jcaller,
23 content::WebContents* web_contents);
24 ~AutofillProviderAndroid() override;
25
26 // Override AutofillProvider methods
sebsg 2017/05/24 13:32:42 The usual syntax is // AutofillProvider: and th
michaelbai 2017/05/26 23:12:07 Done.
27 void OnQueryFormFieldAutofill(AutofillHandlerProxy* handler,
28 int32_t id,
29 const FormData& form,
30 const FormFieldData& field,
31 const gfx::RectF& bounding_box) override;
32
Mathieu 2017/05/24 18:02:01 nit: no need for extra lines in this "override" se
michaelbai 2017/05/26 23:12:07 Done.
33 void OnTextFieldDidChange(AutofillHandlerProxy* handler,
34 const FormData& form,
35 const FormFieldData& field,
36 const base::TimeTicks& timestamp) override;
37
38 void OnWillSubmitForm(AutofillHandlerProxy* handler,
39 const FormData& form,
40 const base::TimeTicks& timestamp) override;
41
42 void OnFocusNoLongerOnForm(AutofillHandlerProxy* handler) override;
43
44 void OnDidFillAutofillFormData(AutofillHandlerProxy* handler,
45 const FormData& form,
46 base::TimeTicks timestamp) override;
47
48 void Reset(AutofillHandlerProxy* handler) override;
49
50 // Methods called by Java.
51 void OnAutofillAvailable(JNIEnv* env, jobject jcaller, jobject formData);
Mathieu 2017/05/24 18:02:01 hacker case everywhere: form_data
michaelbai 2017/05/26 23:12:07 Done.
52
53 private:
54 void OnFocusChanged(bool focus_on_form,
55 size_t index,
56 const gfx::RectF& bounding_box);
57
58 bool ValidateHandler(AutofillHandlerProxy* handler);
59
60 int32_t id_;
61 std::unique_ptr<FormDataAndroid> form_;
62 base::WeakPtr<AutofillHandlerProxy> handler_;
63 JavaObjectWeakGlobalRef java_ref_;
64 content::WebContents* web_contents_;
65
66 DISALLOW_COPY_AND_ASSIGN(AutofillProviderAndroid);
67 };
68
69 bool RegisterAutofillProvider(JNIEnv* env);
70
71 } // namespace autofill
72
73 #endif // COMPONENTS_AUTOFILL_ANDROID_AUTOFILL_PROVIDER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698