| OLD | NEW |
| (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_CORE_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_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 autofill { |
| 13 |
| 14 class FormDataAndroid; |
| 15 |
| 16 class AutofillProviderAndroid : public AutofillProvider { |
| 17 public: |
| 18 AutofillProviderAndroid(const base::android::JavaParamRef<jobject>& jcaller); |
| 19 virtual ~AutofillProviderAndroid(); |
| 20 |
| 21 // Override AutofillProvider methods |
| 22 void OnQueryFormFieldAutofill(AutofillManager* manager, |
| 23 int32_t id, |
| 24 const FormData& form, |
| 25 const FormFieldData& field, |
| 26 const gfx::RectF& bounding_box) override; |
| 27 |
| 28 void OnTextFieldDidChange(AutofillManager* manager, |
| 29 const FormData& form, |
| 30 const FormFieldData& field, |
| 31 const base::TimeTicks& timestamp) override; |
| 32 |
| 33 void OnWillSubmitForm(AutofillManager* manager, |
| 34 const FormData& form, |
| 35 const base::TimeTicks& timestamp) override; |
| 36 |
| 37 void OnFocusNoLongerOnForm(AutofillManager* manager) override; |
| 38 |
| 39 void OnDidFillAutofillFormData(AutofillManager* manager, |
| 40 const FormData& form, |
| 41 base::TimeTicks timestamp) override; |
| 42 |
| 43 // Methods called by Java. |
| 44 void OnAutofillAvailable(JNIEnv* env, jobject jcaller, jobject formData); |
| 45 |
| 46 private: |
| 47 void OnFocusChanged(bool focus_on_form, |
| 48 size_t index, |
| 49 const gfx::RectF& bounding_box); |
| 50 |
| 51 bool ValidateManager(AutofillManager* manager); |
| 52 |
| 53 int32_t id_; |
| 54 std::unique_ptr<FormDataAndroid> form_; |
| 55 base::WeakPtr<AutofillManager> manager_; |
| 56 JavaObjectWeakGlobalRef java_ref_; |
| 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(AutofillProviderAndroid); |
| 59 }; |
| 60 |
| 61 bool RegisterAutofillProvider(JNIEnv* env); |
| 62 |
| 63 } // namespace autofill |
| 64 |
| 65 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROVIDER_ANDROID_H_ |
| OLD | NEW |