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

Unified Diff: android_webview/native/aw_contents.cc

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: rebased 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/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 931e37c678a4ead5345e9283b8af81387a1f5122..a5f81cf0cab7747a479431f8bd9a7c2c5475567a 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -135,8 +135,7 @@ AwContents::AwContents(scoped_ptr<WebContents> web_contents)
new AwRenderViewHostExt(this, web_contents_.get()));
AwAutofillManagerDelegate* autofill_manager_delegate =
- AwBrowserContext::FromWebContents(web_contents_.get())->
- AutofillManagerDelegate();
+ AwAutofillManagerDelegate::FromWebContents(web_contents_.get());
if (autofill_manager_delegate)
InitAutofillIfNecessary(autofill_manager_delegate->GetSaveFormData());
}
@@ -180,10 +179,8 @@ void AwContents::SetSaveFormData(bool enabled) {
// We need to check for the existence, since autofill_manager_delegate
// may not be created when the setting is false.
if (AutofillDriverImpl::FromWebContents(web_contents_.get())) {
- AwAutofillManagerDelegate* autofill_manager_delegate =
- AwBrowserContext::FromWebContents(web_contents_.get())->
- AutofillManagerDelegate();
- autofill_manager_delegate->SetSaveFormData(enabled);
+ AwAutofillManagerDelegate::FromWebContents(web_contents_.get())->
+ SetSaveFormData(enabled);
}
}
@@ -196,10 +193,12 @@ void AwContents::InitAutofillIfNecessary(bool enabled) {
if (AutofillDriverImpl::FromWebContents(web_contents))
return;
+ AwBrowserContext::FromWebContents(web_contents)->
+ CreateUserPrefServiceIfNecessary();
+ AwAutofillManagerDelegate::CreateForWebContents(web_contents);
AutofillDriverImpl::CreateForWebContentsAndDelegate(
web_contents,
- AwBrowserContext::FromWebContents(web_contents)->
- CreateAutofillManagerDelegate(enabled),
+ AwAutofillManagerDelegate::FromWebContents(web_contents),
l10n_util::GetDefaultLocale(),
AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER,
true);

Powered by Google App Engine
This is Rietveld 408576698