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

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 11185011: Remove TabContents from autofill unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove some Created 8 years, 2 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: chrome/browser/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index e4d89a5be997c5bcddd24e557a9924584a188707..2f8c7affddca316fbfebbe36deec6f7afc5d9fc5 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -206,6 +206,8 @@ AutofillManager::AutofillManager(content::WebContents* web_contents,
user_did_edit_autofilled_field_(false),
password_generation_enabled_(false),
external_delegate_(NULL) {
+ // The AutofillManager requires the AutocompleteHistoryManager.
+ AutocompleteHistoryManager::CreateForWebContents(web_contents);
Avi (use Gerrit) 2012/10/16 22:04:28 This is a very interesting question. Is the Autoco
Ilya Sherman 2012/10/19 00:05:27 I think that's reasonable.
// |personal_data_| is NULL when using test-enabled WebContents.
personal_data_ = PersonalDataManagerFactory::GetForProfile(
delegate->GetOriginalProfile());
@@ -316,6 +318,15 @@ void AutofillManager::DidNavigateMainFrame(
Reset();
}
+void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) {
+ // TODO(jrg): consider passing delegate into the ctor. That won't
+ // work if the delegate has a pointer to the AutofillManager, but
+ // future directions may not need such a pointer.
+ external_delegate_ = delegate;
+ AutocompleteHistoryManager::FromWebContents(web_contents())->
+ SetExternalDelegate(delegate);
+}
+
bool AutofillManager::HasExternalDelegate() {
return external_delegate_ != NULL;
}
@@ -914,6 +925,8 @@ AutofillManager::AutofillManager(content::WebContents* web_contents,
external_delegate_(NULL) {
DCHECK(web_contents);
DCHECK(manager_delegate_);
+ // The AutofillManager requires the AutocompleteHistoryManager.
+ AutocompleteHistoryManager::CreateForWebContents(web_contents);
RegisterWithSyncService();
// Test code doesn't need registrar_.
}

Powered by Google App Engine
This is Rietveld 408576698