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

Unified Diff: android_webview/native/aw_contents.cc

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to review of PS #6 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 8d726da2afbd400a57ef2123a8eca18634835f8a..2136bf4c0bebce2f9d63bec653e9cc0e678dd06a 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -28,9 +28,9 @@
#include "base/pickle.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
-#include "components/autofill/browser/autofill_external_delegate.h"
#include "components/autofill/browser/autofill_manager.h"
#include "components/autofill/browser/webdata/autofill_webdata_service.h"
+#include "components/autofill/content/browser/autofill_driver_impl.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/browser_thread.h"
@@ -48,7 +48,7 @@
struct AwDrawSWFunctionTable;
struct AwDrawGLFunctionTable;
-using autofill::AutofillExternalDelegate;
+using autofill::AutofillDriverImpl;
using autofill::AutofillManager;
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF16;
@@ -164,7 +164,7 @@ void AwContents::SetSaveFormData(bool enabled) {
InitAutofillIfNecessary(enabled);
// We need to check for the existence, since autofill_manager_delegate
// may not be created when the setting is false.
- if (AutofillManager::FromWebContents(web_contents_.get())) {
+ if (AutofillDriverImpl::FromWebContents(web_contents_.get())) {
AwAutofillManagerDelegate* autofill_manager_delegate =
AwBrowserContext::FromWebContents(web_contents_.get())->
AutofillManagerDelegate();
@@ -178,22 +178,16 @@ void AwContents::InitAutofillIfNecessary(bool enabled) {
return;
// Check if the autofill manager already exists.
content::WebContents* web_contents = web_contents_.get();
- if (AutofillManager::FromWebContents(web_contents))
+ if (AutofillDriverImpl::FromWebContents(web_contents))
return;
- AutofillManager::CreateForWebContentsAndDelegate(
+ AutofillDriverImpl::CreateForWebContentsAndDelegate(
web_contents,
AwBrowserContext::FromWebContents(web_contents)->
CreateAutofillManagerDelegate(enabled),
l10n_util::GetDefaultLocale(),
- AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
- AutofillManager* autofill_manager =
- AutofillManager::FromWebContents(web_contents);
- AutofillExternalDelegate::CreateForWebContentsAndManager(
- web_contents,
- autofill_manager);
- autofill_manager->SetExternalDelegate(
- AutofillExternalDelegate::FromWebContents(web_contents));
+ AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER,
+ true);
}
void AwContents::SetWebContents(JNIEnv* env, jobject obj, jint new_wc) {

Powered by Google App Engine
This is Rietveld 408576698