OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
6 #define ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/autofill/core/browser/autofill_client.h" | 14 #include "components/autofill/core/browser/autofill_client.h" |
15 #include "components/prefs/pref_registry_simple.h" | 15 #include "components/prefs/pref_registry_simple.h" |
16 #include "components/prefs/pref_service_factory.h" | 16 #include "components/prefs/pref_service_factory.h" |
17 #include "content/public/browser/web_contents_user_data.h" | 17 #include "content/public/browser/web_contents_user_data.h" |
| 18 #include "ui/android/view_android.h" |
18 | 19 |
19 namespace autofill { | 20 namespace autofill { |
20 class AutofillMetrics; | 21 class AutofillMetrics; |
21 class AutofillPopupDelegate; | 22 class AutofillPopupDelegate; |
22 class CardUnmaskDelegate; | 23 class CardUnmaskDelegate; |
23 class CreditCard; | 24 class CreditCard; |
24 class FormStructure; | 25 class FormStructure; |
25 class PasswordGenerator; | 26 class PasswordGenerator; |
26 class PersonalDataManager; | 27 class PersonalDataManager; |
27 struct FormData; | 28 struct FormData; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void PropagateAutofillPredictions( | 98 void PropagateAutofillPredictions( |
98 content::RenderFrameHost* rfh, | 99 content::RenderFrameHost* rfh, |
99 const std::vector<autofill::FormStructure*>& forms) override; | 100 const std::vector<autofill::FormStructure*>& forms) override; |
100 void DidFillOrPreviewField(const base::string16& autofilled_value, | 101 void DidFillOrPreviewField(const base::string16& autofilled_value, |
101 const base::string16& profile_full_name) override; | 102 const base::string16& profile_full_name) override; |
102 void OnFirstUserGestureObserved() override; | 103 void OnFirstUserGestureObserved() override; |
103 bool IsContextSecure(const GURL& form_origin) override; | 104 bool IsContextSecure(const GURL& form_origin) override; |
104 bool ShouldShowSigninPromo() override; | 105 bool ShouldShowSigninPromo() override; |
105 void StartSigninFlow() override; | 106 void StartSigninFlow() override; |
106 | 107 |
| 108 void Dismissed(JNIEnv* env, |
| 109 const base::android::JavaParamRef<jobject>& obj); |
107 void SuggestionSelected(JNIEnv* env, | 110 void SuggestionSelected(JNIEnv* env, |
108 const base::android::JavaParamRef<jobject>& obj, | 111 const base::android::JavaParamRef<jobject>& obj, |
109 jint position); | 112 jint position); |
110 | 113 |
111 private: | 114 private: |
112 AwAutofillClient(content::WebContents* web_contents); | 115 AwAutofillClient(content::WebContents* web_contents); |
113 friend class content::WebContentsUserData<AwAutofillClient>; | 116 friend class content::WebContentsUserData<AwAutofillClient>; |
114 | 117 |
115 void ShowAutofillPopupImpl( | 118 void ShowAutofillPopupImpl( |
116 const gfx::RectF& element_bounds, | 119 const gfx::RectF& element_bounds, |
117 bool is_rtl, | 120 bool is_rtl, |
118 const std::vector<autofill::Suggestion>& suggestions); | 121 const std::vector<autofill::Suggestion>& suggestions); |
119 | 122 |
120 // The web_contents associated with this delegate. | 123 // The web_contents associated with this delegate. |
121 content::WebContents* web_contents_; | 124 content::WebContents* web_contents_; |
122 bool save_form_data_; | 125 bool save_form_data_; |
123 JavaObjectWeakGlobalRef java_ref_; | 126 JavaObjectWeakGlobalRef java_ref_; |
124 | 127 |
| 128 ui::ViewAndroid::ScopedAnchorView anchor_view_; |
| 129 |
125 // The current Autofill query values. | 130 // The current Autofill query values. |
126 std::vector<autofill::Suggestion> suggestions_; | 131 std::vector<autofill::Suggestion> suggestions_; |
127 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; | 132 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; |
128 | 133 |
129 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); | 134 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); |
130 }; | 135 }; |
131 | 136 |
132 bool RegisterAwAutofillClient(JNIEnv* env); | 137 bool RegisterAwAutofillClient(JNIEnv* env); |
133 | 138 |
134 } // namespace android_webview | 139 } // namespace android_webview |
135 | 140 |
136 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 141 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
OLD | NEW |