| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | |
| 11 #include "base/prefs/pref_service_builder.h" | |
| 12 #include "components/autofill/browser/autofill_manager_delegate.h" | 10 #include "components/autofill/browser/autofill_manager_delegate.h" |
| 11 #include "content/public/browser/web_contents_user_data.h" |
| 13 | 12 |
| 14 namespace autofill { | 13 namespace autofill { |
| 15 class AutofillMetrics; | 14 class AutofillMetrics; |
| 16 class AutofillPopupDelegate; | 15 class AutofillPopupDelegate; |
| 17 class CreditCard; | 16 class CreditCard; |
| 18 class FormStructure; | 17 class FormStructure; |
| 19 class PasswordGenerator; | 18 class PasswordGenerator; |
| 20 class PersonalDataManager; | 19 class PersonalDataManager; |
| 21 struct FormData; | 20 struct FormData; |
| 22 namespace autocheckout { | 21 namespace autocheckout { |
| 23 class WhitelistManager; | 22 class WhitelistManager; |
| 24 } | 23 } |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class WebContents; | 27 class WebContents; |
| 29 } | 28 } |
| 30 | 29 |
| 31 class PersonalDataManager; | 30 class PersonalDataManager; |
| 32 class PrefService; | 31 class PrefService; |
| 33 | 32 |
| 34 namespace android_webview { | 33 namespace android_webview { |
| 35 | 34 |
| 36 class AwAutofillManagerDelegate : | 35 // Manager delegate for the autofill functionality. Android webview |
| 37 public autofill::AutofillManagerDelegate { | 36 // supports enabling autocomplete feature for each webview instance |
| 37 // (different than the browser which supports enabling/disabling for |
| 38 // a profile). Since there is only one pref service for a given browser |
| 39 // context, we cannot enable this feature via UserPrefs. Rather, we always |
| 40 // keep the feature enabled at the pref service, and control it via |
| 41 // the delegates. |
| 42 class AwAutofillManagerDelegate |
| 43 : public autofill::AutofillManagerDelegate, |
| 44 public content::WebContentsUserData<AwAutofillManagerDelegate> { |
| 45 |
| 38 public: | 46 public: |
| 39 AwAutofillManagerDelegate(bool enabled); | |
| 40 virtual ~AwAutofillManagerDelegate(); | 47 virtual ~AwAutofillManagerDelegate(); |
| 41 | 48 |
| 42 void SetSaveFormData(bool enabled); | 49 void SetSaveFormData(bool enabled); |
| 43 bool GetSaveFormData(); | 50 bool GetSaveFormData(); |
| 44 | 51 |
| 45 // AutofillManagerDelegate implementation. | 52 // AutofillManagerDelegate implementation. |
| 46 virtual autofill::PersonalDataManager* GetPersonalDataManager() OVERRIDE; | 53 virtual autofill::PersonalDataManager* GetPersonalDataManager() OVERRIDE; |
| 47 virtual PrefService* GetPrefs() OVERRIDE; | 54 virtual PrefService* GetPrefs() OVERRIDE; |
| 48 virtual autofill::autocheckout::WhitelistManager* | 55 virtual autofill::autocheckout::WhitelistManager* |
| 49 GetAutocheckoutWhitelistManager() const OVERRIDE; | 56 GetAutocheckoutWhitelistManager() const OVERRIDE; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 const gfx::RectF& element_bounds, | 76 const gfx::RectF& element_bounds, |
| 70 const std::vector<string16>& values, | 77 const std::vector<string16>& values, |
| 71 const std::vector<string16>& labels, | 78 const std::vector<string16>& labels, |
| 72 const std::vector<string16>& icons, | 79 const std::vector<string16>& icons, |
| 73 const std::vector<int>& identifiers, | 80 const std::vector<int>& identifiers, |
| 74 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE; | 81 base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE; |
| 75 virtual void HideAutofillPopup() OVERRIDE; | 82 virtual void HideAutofillPopup() OVERRIDE; |
| 76 virtual void UpdateProgressBar(double value) OVERRIDE; | 83 virtual void UpdateProgressBar(double value) OVERRIDE; |
| 77 | 84 |
| 78 private: | 85 private: |
| 86 AwAutofillManagerDelegate(content::WebContents* contents); |
| 87 friend class content::WebContentsUserData<AwAutofillManagerDelegate>; |
| 88 |
| 89 bool save_form_data_; |
| 90 |
| 79 DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate); | 91 DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate); |
| 80 }; | 92 }; |
| 81 | 93 |
| 82 } // namespace android_webview | 94 } // namespace android_webview |
| 83 | 95 |
| 84 #endif // ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ | 96 #endif // ANDROID_WEBVIEW_BROWSER_AW_AUTOFILL_MANAGER_DELEGATE_H_ |
| OLD | NEW |