Index: android_webview/browser/aw_autofill_manager_delegate.h |
diff --git a/android_webview/browser/aw_autofill_manager_delegate.h b/android_webview/browser/aw_autofill_manager_delegate.h |
index c65b736dbd49b218d698e78bb400144668a46b63..25950f93b16db28e2d43b1eb6d30566f9926bc0e 100644 |
--- a/android_webview/browser/aw_autofill_manager_delegate.h |
+++ b/android_webview/browser/aw_autofill_manager_delegate.h |
@@ -7,9 +7,8 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
-#include "base/prefs/pref_registry_simple.h" |
-#include "base/prefs/pref_service_builder.h" |
#include "components/autofill/browser/autofill_manager_delegate.h" |
+#include "content/public/browser/web_contents_user_data.h" |
namespace autofill { |
class AutofillMetrics; |
@@ -33,10 +32,18 @@ class PrefService; |
namespace android_webview { |
-class AwAutofillManagerDelegate : |
- public autofill::AutofillManagerDelegate { |
+// Manager delegate for the autofill functionality. Android webview |
+// supports enabling autocomplete feature for each webview instance |
+// (different than the browser which supports enabling/disabling for |
+// a profile). Since there is only one pref service for a given browser |
+// context, we cannot enable this feature via UserPrefs. Rather, we always |
+// keep the feature enabled at the pref service, and control it via |
+// the delegates. |
+class AwAutofillManagerDelegate |
+ : public autofill::AutofillManagerDelegate, |
+ public content::WebContentsUserData<AwAutofillManagerDelegate> { |
+ |
public: |
- AwAutofillManagerDelegate(bool enabled); |
virtual ~AwAutofillManagerDelegate(); |
void SetSaveFormData(bool enabled); |
@@ -75,8 +82,17 @@ class AwAutofillManagerDelegate : |
base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE; |
virtual void HideAutofillPopup() OVERRIDE; |
virtual void UpdateProgressBar(double value) OVERRIDE; |
+ virtual bool ShouldIgnoreFormData() OVERRIDE; |
private: |
+ AwAutofillManagerDelegate(content::WebContents* contents); |
+ friend class content::WebContentsUserData<AwAutofillManagerDelegate>; |
+ |
+ // The web_contents associated with this delegate. |
+ content::WebContents* web_contents_; |
+ |
+ bool save_form_data_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AwAutofillManagerDelegate); |
}; |