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 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 void DidFillOrPreviewField(const base::string16& autofilled_value, | 98 void DidFillOrPreviewField(const base::string16& autofilled_value, |
99 const base::string16& profile_full_name) override; | 99 const base::string16& profile_full_name) override; |
100 void OnFirstUserGestureObserved() override; | 100 void OnFirstUserGestureObserved() override; |
101 bool IsContextSecure(const GURL& form_origin) override; | 101 bool IsContextSecure(const GURL& form_origin) override; |
102 bool ShouldShowSigninPromo() override; | 102 bool ShouldShowSigninPromo() override; |
103 void StartSigninFlow() override; | 103 void StartSigninFlow() override; |
104 | 104 |
105 void SuggestionSelected(JNIEnv* env, | 105 void SuggestionSelected(JNIEnv* env, |
106 const base::android::JavaParamRef<jobject>& obj, | 106 const base::android::JavaParamRef<jobject>& obj, |
107 jint position); | 107 jint position); |
| 108 void SetViewAndroid(ui::ViewAndroid* view_android); |
108 | 109 |
109 private: | 110 private: |
110 AwAutofillClient(content::WebContents* web_contents); | 111 AwAutofillClient(content::WebContents* web_contents); |
111 friend class content::WebContentsUserData<AwAutofillClient>; | 112 friend class content::WebContentsUserData<AwAutofillClient>; |
112 | 113 |
113 void ShowAutofillPopupImpl( | 114 void ShowAutofillPopupImpl( |
114 const gfx::RectF& element_bounds, | 115 const gfx::RectF& element_bounds, |
115 bool is_rtl, | 116 bool is_rtl, |
116 const std::vector<autofill::Suggestion>& suggestions); | 117 const std::vector<autofill::Suggestion>& suggestions); |
117 | 118 |
118 // The web_contents associated with this delegate. | 119 // The web_contents associated with this delegate. |
119 content::WebContents* web_contents_; | 120 content::WebContents* web_contents_; |
120 bool save_form_data_; | 121 bool save_form_data_; |
121 JavaObjectWeakGlobalRef java_ref_; | 122 JavaObjectWeakGlobalRef java_ref_; |
122 | 123 |
| 124 base::android::ScopedJavaGlobalRef<jobject> anchor_view_; |
| 125 ui::ViewAndroid* view_android_; |
| 126 |
123 // The current Autofill query values. | 127 // The current Autofill query values. |
124 std::vector<autofill::Suggestion> suggestions_; | 128 std::vector<autofill::Suggestion> suggestions_; |
125 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; | 129 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; |
126 | 130 |
127 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); | 131 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); |
128 }; | 132 }; |
129 | 133 |
130 bool RegisterAwAutofillClient(JNIEnv* env); | 134 bool RegisterAwAutofillClient(JNIEnv* env); |
131 | 135 |
132 } // namespace android_webview | 136 } // namespace android_webview |
133 | 137 |
134 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 138 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
OLD | NEW |