Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 class FormStructure; | 23 class FormStructure; |
| 24 class PasswordGenerator; | 24 class PasswordGenerator; |
| 25 class PersonalDataManager; | 25 class PersonalDataManager; |
| 26 struct FormData; | 26 struct FormData; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 class WebContents; | 30 class WebContents; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace infobars { | |
| 34 class InfoBarManager; | |
| 35 } | |
|
Peter Kasting
2014/12/23 21:20:34
Seems like we shouldn't need this, the base class
Pritam Nikam
2014/12/24 11:16:57
Done.
| |
| 36 | |
| 33 namespace gfx { | 37 namespace gfx { |
| 34 class RectF; | 38 class RectF; |
| 35 } | 39 } |
| 36 | 40 |
| 37 class PersonalDataManager; | 41 class PersonalDataManager; |
| 38 class PrefService; | 42 class PrefService; |
| 39 | 43 |
| 40 namespace android_webview { | 44 namespace android_webview { |
| 41 | 45 |
| 42 // Manager delegate for the autofill functionality. Android webview | 46 // Manager delegate for the autofill functionality. Android webview |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 55 bool GetSaveFormData(); | 59 bool GetSaveFormData(); |
| 56 | 60 |
| 57 // AutofillClient: | 61 // AutofillClient: |
| 58 virtual autofill::PersonalDataManager* GetPersonalDataManager() override; | 62 virtual autofill::PersonalDataManager* GetPersonalDataManager() override; |
| 59 virtual scoped_refptr<autofill::AutofillWebDataService> GetDatabase() | 63 virtual scoped_refptr<autofill::AutofillWebDataService> GetDatabase() |
| 60 override; | 64 override; |
| 61 virtual PrefService* GetPrefs() override; | 65 virtual PrefService* GetPrefs() override; |
| 62 virtual void HideRequestAutocompleteDialog() override; | 66 virtual void HideRequestAutocompleteDialog() override; |
| 63 virtual void ShowAutofillSettings() override; | 67 virtual void ShowAutofillSettings() override; |
| 64 virtual void ShowUnmaskPrompt() override; | 68 virtual void ShowUnmaskPrompt() override; |
| 65 virtual void ConfirmSaveCreditCard( | |
| 66 const base::Closure& save_card_callback) override; | |
| 67 virtual bool HasCreditCardScanFeature() override; | 69 virtual bool HasCreditCardScanFeature() override; |
| 68 virtual void ScanCreditCard(const CreditCardScanCallback& callback) override; | 70 virtual void ScanCreditCard(const CreditCardScanCallback& callback) override; |
| 69 virtual void ShowRequestAutocompleteDialog( | 71 virtual void ShowRequestAutocompleteDialog( |
| 70 const autofill::FormData& form, | 72 const autofill::FormData& form, |
| 71 const GURL& source_url, | 73 const GURL& source_url, |
| 72 const ResultCallback& callback) override; | 74 const ResultCallback& callback) override; |
| 73 virtual void ShowAutofillPopup( | 75 virtual void ShowAutofillPopup( |
| 74 const gfx::RectF& element_bounds, | 76 const gfx::RectF& element_bounds, |
| 75 base::i18n::TextDirection text_direction, | 77 base::i18n::TextDirection text_direction, |
| 76 const std::vector<autofill::Suggestion>& suggestions, | 78 const std::vector<autofill::Suggestion>& suggestions, |
| 77 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override; | 79 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) override; |
| 78 virtual void UpdateAutofillPopupDataListValues( | 80 virtual void UpdateAutofillPopupDataListValues( |
| 79 const std::vector<base::string16>& values, | 81 const std::vector<base::string16>& values, |
| 80 const std::vector<base::string16>& labels) override; | 82 const std::vector<base::string16>& labels) override; |
| 81 virtual void HideAutofillPopup() override; | 83 virtual void HideAutofillPopup() override; |
| 82 virtual bool IsAutocompleteEnabled() override; | 84 virtual bool IsAutocompleteEnabled() override; |
| 83 virtual void DetectAccountCreationForms( | 85 virtual void DetectAccountCreationForms( |
| 84 content::RenderFrameHost* rfh, | 86 content::RenderFrameHost* rfh, |
| 85 const std::vector<autofill::FormStructure*>& forms) override; | 87 const std::vector<autofill::FormStructure*>& forms) override; |
| 86 virtual void DidFillOrPreviewField( | 88 virtual void DidFillOrPreviewField( |
| 87 const base::string16& autofilled_value, | 89 const base::string16& autofilled_value, |
| 88 const base::string16& profile_full_name) override; | 90 const base::string16& profile_full_name) override; |
| 89 virtual void OnFirstUserGestureObserved() override; | 91 virtual void OnFirstUserGestureObserved() override; |
| 92 virtual infobars::InfoBarManager* GetInfoBarManager() override; | |
| 90 | 93 |
| 91 void SuggestionSelected(JNIEnv* env, jobject obj, jint position); | 94 void SuggestionSelected(JNIEnv* env, jobject obj, jint position); |
| 92 | 95 |
| 93 private: | 96 private: |
| 94 AwAutofillClient(content::WebContents* web_contents); | 97 AwAutofillClient(content::WebContents* web_contents); |
| 95 friend class content::WebContentsUserData<AwAutofillClient>; | 98 friend class content::WebContentsUserData<AwAutofillClient>; |
| 96 | 99 |
| 97 void ShowAutofillPopupImpl( | 100 void ShowAutofillPopupImpl( |
| 98 const gfx::RectF& element_bounds, | 101 const gfx::RectF& element_bounds, |
| 99 bool is_rtl, | 102 bool is_rtl, |
| 100 const std::vector<autofill::Suggestion>& suggestions); | 103 const std::vector<autofill::Suggestion>& suggestions); |
| 101 | 104 |
| 102 // The web_contents associated with this delegate. | 105 // The web_contents associated with this delegate. |
| 103 content::WebContents* web_contents_; | 106 content::WebContents* web_contents_; |
| 104 bool save_form_data_; | 107 bool save_form_data_; |
| 105 JavaObjectWeakGlobalRef java_ref_; | 108 JavaObjectWeakGlobalRef java_ref_; |
| 106 | 109 |
| 107 // The current Autofill query values. | 110 // The current Autofill query values. |
| 108 std::vector<autofill::Suggestion> suggestions_; | 111 std::vector<autofill::Suggestion> suggestions_; |
| 109 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; | 112 base::WeakPtr<autofill::AutofillPopupDelegate> delegate_; |
| 110 | 113 |
| 111 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); | 114 DISALLOW_COPY_AND_ASSIGN(AwAutofillClient); |
| 112 }; | 115 }; |
| 113 | 116 |
| 114 bool RegisterAwAutofillClient(JNIEnv* env); | 117 bool RegisterAwAutofillClient(JNIEnv* env); |
| 115 | 118 |
| 116 } // namespace android_webview | 119 } // namespace android_webview |
| 117 | 120 |
| 118 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ | 121 #endif // ANDROID_WEBVIEW_NATIVE_AW_AUTOFILL_CLIENT_H_ |
| OLD | NEW |