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

Unified Diff: android_webview/browser/aw_autofill_external_delegate.cc

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: make personal_data_ optional Created 7 years, 7 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_external_delegate.cc
diff --git a/android_webview/browser/aw_autofill_external_delegate.cc b/android_webview/browser/aw_autofill_external_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0cc9f52b1491bced79269dc60288af909b6bf4e1
--- /dev/null
+++ b/android_webview/browser/aw_autofill_external_delegate.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "android_webview/browser/aw_autofill_external_delegate.h"
+
+#include "android_webview/browser/aw_autofill_manager_delegate.h"
+#include "components/autofill/browser/autofill_manager.h"
+#include "content/public/browser/web_contents.h"
+
+using autofill::AutofillManager;
+
+namespace android_webview {
+
+void AwAutofillExternalDelegate::CreateForWebContentsAndManager(
+ content::WebContents* web_contents,
+ AutofillManager* autofill_manager) {
+ if (FromWebContents(web_contents))
benm (inactive) 2013/05/23 12:02:21 DCHECK?
sgurun-gerrit only 2013/05/23 17:10:01 Done.
+ return;
+
+ web_contents->SetUserData(
+ UserDataKey(),
+ new AwAutofillExternalDelegate(web_contents, autofill_manager));
+}
+
+AwAutofillExternalDelegate::AwAutofillExternalDelegate(
+ content::WebContents* web_contents,
+ AutofillManager* autofill_manager)
+ : autofill::AutofillExternalDelegate(web_contents, autofill_manager) {
+}
+
+AwAutofillExternalDelegate::~AwAutofillExternalDelegate() {}
+
+bool AwAutofillExternalDelegate::ShouldIgnoreFormData() {
+ return !AwAutofillManagerDelegate::FromWebContents(web_contents())->
+ GetSaveFormData();
+}
+
+} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698