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 |