| Index: android_webview/native/aw_contents.cc
|
| diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
|
| index 5d348686112afc1623dec547e209268a2db50412..26b310062ec9ae34ed143ad05be64ea10e34635f 100644
|
| --- a/android_webview/native/aw_contents.cc
|
| +++ b/android_webview/native/aw_contents.cc
|
| @@ -54,6 +54,7 @@
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "components/autofill/content/browser/content_autofill_driver_factory.h"
|
| #include "components/autofill/core/browser/autofill_manager.h"
|
| +#include "components/autofill/core/browser/autofill_provider_android.h"
|
| #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
|
| #include "components/navigation_interception/intercept_navigation_delegate.h"
|
| #include "content/public/browser/android/content_view_core.h"
|
| @@ -297,11 +298,22 @@ void AwContents::InitAutofillIfNecessary(bool enabled) {
|
| if (ContentAutofillDriverFactory::FromWebContents(web_contents))
|
| return;
|
|
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + JNIEnv* env = AttachCurrentThread();
|
| + ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
|
| + if (obj.is_null())
|
| + return;
|
| +
|
| + jlong nativeAutofillProvider =
|
| + Java_AwContents_getNativeAutofillAndroid(env, obj);
|
| + autofill_provider_.reset(
|
| + reinterpret_cast<autofill::AutofillProvider*>(nativeAutofillProvider));
|
| AwAutofillClient::CreateForWebContents(web_contents);
|
| ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
|
| web_contents, AwAutofillClient::FromWebContents(web_contents),
|
| base::android::GetDefaultLocaleString(),
|
| - AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
|
| + AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER,
|
| + autofill_provider_.get());
|
| }
|
|
|
| void AwContents::SetAwAutofillClient(const JavaRef<jobject>& client) {
|
|
|