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_. |
} |