Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1647)

Unified Diff: android_webview/browser/aw_autofill_manager_delegate.h

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: address nits Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 b1635d24000c833f6620d261e57fec9838edfe77..dd01ce9e8bf8847ccb437d95c0fd7fa003a53d03 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);
@@ -76,8 +83,17 @@ class AwAutofillManagerDelegate :
base::WeakPtr<autofill::AutofillPopupDelegate> delegate) OVERRIDE;
virtual void HideAutofillPopup() OVERRIDE;
virtual void UpdateProgressBar(double value) OVERRIDE;
+ virtual bool IsAutocompleteEnabled() 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);
};

Powered by Google App Engine
This is Rietveld 408576698