| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const base::Closure& save_card_callback) override; | 66 const base::Closure& save_card_callback) override; |
| 67 virtual bool HasCreditCardScanFeature() override; | 67 virtual bool HasCreditCardScanFeature() override; |
| 68 virtual void ScanCreditCard(const CreditCardScanCallback& callback) override; | 68 virtual void ScanCreditCard(const CreditCardScanCallback& callback) override; |
| 69 virtual void ShowRequestAutocompleteDialog( | 69 virtual void ShowRequestAutocompleteDialog( |
| 70 const autofill::FormData& form, | 70 const autofill::FormData& form, |
| 71 const GURL& source_url, | 71 const GURL& source_url, |
| 72 const ResultCallback& callback) override; | 72 const ResultCallback& callback) override; |
| 73 virtual void ShowAutofillPopup( | 73 virtual void ShowAutofillPopup( |
| 74 const gfx::RectF& element_bounds, | 74 const gfx::RectF& element_bounds, |
| 75 base::i18n::TextDirection text_direction, | 75 base::i18n::TextDirection text_direction, |
| 76 const std::vector<base::string16>& values, | 76 const std::vector<autofill::Suggestion>& suggestions, |
| 77 const std::vector<base::string16>& labels, | |
| 78 const std::vector<base::string16>& icons, | |
| 79 const std::vector<int>& identifiers, | |
| 80 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override; | 77 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override; |
| 81 virtual void UpdateAutofillPopupDataListValues( | 78 virtual void UpdateAutofillPopupDataListValues( |
| 82 const std::vector<base::string16>& values, | 79 const std::vector<base::string16>& values, |
| 83 const std::vector<base::string16>& labels) override; | 80 const std::vector<base::string16>& labels) override; |
| 84 virtual void HideAutofillPopup() override; | 81 virtual void HideAutofillPopup() override; |
| 85 virtual bool IsAutocompleteEnabled() override; | 82 virtual bool IsAutocompleteEnabled() override; |
| 86 virtual void DetectAccountCreationForms( | 83 virtual void DetectAccountCreationForms( |
| 87 content::RenderFrameHost* rfh, | 84 content::RenderFrameHost* rfh, |
| 88 const std::vector<autofill::FormStructure*>& forms) override; | 85 const std::vector<autofill::FormStructure*>& forms) override; |
| 89 virtual void DidFillOrPreviewField( | 86 virtual void DidFillOrPreviewField( |
| 90 const base::string16& autofilled_value, | 87 const base::string16& autofilled_value, |
| 91 const base::string16& profile_full_name) override; | 88 const base::string16& profile_full_name) override; |
| 92 virtual void OnFirstUserGestureObserved() override; | 89 virtual void OnFirstUserGestureObserved() override; |
| 93 | 90 |
| 94 void SuggestionSelected(JNIEnv* env, jobject obj, jint position); | 91 void SuggestionSelected(JNIEnv* env, jobject obj, jint position); |
| 95 | 92 |
| 96 private: | 93 private: |
| 97 AwAutofillClient(content::WebContents* web_contents); | 94 AwAutofillClient(content::WebContents* web_contents); |
| 98 friend class content::WebContentsUserData<AwAutofillClient>; | 95 friend class content::WebContentsUserData<AwAutofillClient>; |
| 99 | 96 |
| 100 void ShowAutofillPopupImpl(const gfx::RectF& element_bounds, | 97 void ShowAutofillPopupImpl( |
| 101 bool is_rtl, | 98 const gfx::RectF& element_bounds, |
| 102 const std::vector<base::string16>& values, | 99 bool is_rtl, |
| 103 const std::vector<base::string16>& labels, | 100 const std::vector<autofill::Suggestion>& suggestions); |
| 104 const std::vector<int>& identifiers); | |
| 105 | 101 |
| 106 // The web_contents associated with this delegate. | 102 // The web_contents associated with this delegate. |
| 107 content::WebContents* web_contents_; | 103 content::WebContents* web_contents_; |
| 108 bool save_form_data_; | 104 bool save_form_data_; |
| 109 JavaObjectWeakGlobalRef java_ref_; | 105 JavaObjectWeakGlobalRef java_ref_; |
| 110 | 106 |
| 111 // The current Autofill query values. | 107 // The current Autofill query values. |
| 112 std::vector<base::string16> values_; | 108 std::vector<autofill::Suggestion> suggestions_; |
| 113 std::vector<int> identifiers_; | |
| 114 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; | 109 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; |
| 115 | 110 |
| 116 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); | 111 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); |
| 117 }; | 112 }; |
| 118 | 113 |
| 119 bool RegisterAwAutofillClient(JNIEnv* env); | 114 bool RegisterAwAutofillClient(JNIEnv* env); |
| 120 | 115 |
| 121 } // namespace android_webview | 116 } // namespace android_webview |
| 122 | 117 |
| 123 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 118 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
| OLD | NEW |