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

Unified Diff: components/autofill/content/browser/autofill_driver_impl.cc

Issue 17225008: Eliminate AutofillExternalDelegate being a WebContentsUserData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review 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 | « components/autofill/content/browser/autofill_driver_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/browser/autofill_driver_impl.cc
diff --git a/components/autofill/content/browser/autofill_driver_impl.cc b/components/autofill/content/browser/autofill_driver_impl.cc
index 02963520d9e218aaacca8bf618afd6b390f49196..4b76fb5fd17733b1fcaeb177565b519bdc318848 100644
--- a/components/autofill/content/browser/autofill_driver_impl.cc
+++ b/components/autofill/content/browser/autofill_driver_impl.cc
@@ -57,12 +57,8 @@ AutofillDriverImpl::AutofillDriverImpl(
: content::WebContentsObserver(web_contents),
autofill_manager_(this, delegate, app_locale, enable_download_manager) {
if (enable_native_ui) {
- // TODO(blundell): Eliminate AutofillExternalDelegate being a WCUD and
- // transfer ownership of it to this class.
- AutofillExternalDelegate::CreateForWebContentsAndManager(
- web_contents, &autofill_manager_);
- autofill_manager_.SetExternalDelegate(
- AutofillExternalDelegate::FromWebContents(web_contents));
+ SetAutofillExternalDelegate(scoped_ptr<AutofillExternalDelegate>(
+ new AutofillExternalDelegate(web_contents, &autofill_manager_)));
}
}
@@ -84,4 +80,10 @@ void AutofillDriverImpl::DidNavigateMainFrame(
autofill_manager_.DidNavigateMainFrame(details, params);
}
+void AutofillDriverImpl::SetAutofillExternalDelegate(
+ scoped_ptr<AutofillExternalDelegate> delegate) {
+ autofill_external_delegate_.reset(delegate.release());
+ autofill_manager_.SetExternalDelegate(autofill_external_delegate_.get());
+}
+
} // namespace autofill
« no previous file with comments | « components/autofill/content/browser/autofill_driver_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698