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

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: add a check that disappeared during a merge. 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
« no previous file with comments | « android_webview/android_webview.gyp ('k') | android_webview/browser/aw_autofill_manager_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8c7b3e3036be4a7183a359056f53686129685687..58f4e138c91f18e208c60ce9b8b71b2e1026e8bb 100644
--- a/android_webview/browser/aw_autofill_manager_delegate.h
+++ b/android_webview/browser/aw_autofill_manager_delegate.h
@@ -10,6 +10,7 @@
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service_builder.h"
#include "components/autofill/core/browser/autofill_manager_delegate.h"
+#include "content/public/browser/web_contents_user_data.h"
namespace autofill {
class AutofillMetrics;
@@ -33,10 +34,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 +85,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);
};
« no previous file with comments | « android_webview/android_webview.gyp ('k') | android_webview/browser/aw_autofill_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698