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

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

Issue 15097004: Enable Autocomplete feature for chromium webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setSaveFormData2
Patch Set: rebased for IPC changes 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: components/autofill/browser/autofill_manager.cc
diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc
index d6a5e838d8ad557f8f656c2baaa1e49ebed6c23e..9570a7d0c49bfaaf5c62624cb8bea232f753d7ea 100644
--- a/components/autofill/browser/autofill_manager.cc
+++ b/components/autofill/browser/autofill_manager.cc
@@ -191,7 +191,6 @@ AutofillManager::AutofillManager(
manager_delegate_(delegate),
app_locale_(app_locale),
personal_data_(delegate->GetPersonalDataManager()),
- autocomplete_history_manager_(driver),
autocheckout_manager_(this),
metric_logger_(new AutofillMetrics),
has_logged_autofill_enabled_(false),
@@ -203,6 +202,8 @@ AutofillManager::AutofillManager(
external_delegate_(NULL),
test_delegate_(NULL),
weak_ptr_factory_(this) {
+ autocomplete_history_manager_.reset(
+ new AutocompleteHistoryManager(driver,delegate));
Ilya Sherman 2013/06/19 00:38:27 nit: Please include a space after the comma.
Ilya Sherman 2013/06/19 00:38:27 nit: Why did this get moved out of the initializer
sgurun-gerrit only 2013/06/19 17:56:23 Done.
sgurun-gerrit only 2013/06/19 17:56:23 Done.
if (enable_download_manager == ENABLE_AUTOFILL_DOWNLOAD_MANAGER) {
download_manager_.reset(
new AutofillDownloadManager(
@@ -252,7 +253,7 @@ void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) {
// work if the delegate has a pointer to the AutofillManager, but
// future directions may not need such a pointer.
external_delegate_ = delegate;
- autocomplete_history_manager_.SetExternalDelegate(delegate);
+ autocomplete_history_manager_->SetExternalDelegate(delegate);
}
bool AutofillManager::IsNativeUiEnabled() {
@@ -304,8 +305,8 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
bool AutofillManager::OnFormSubmitted(const FormData& form,
const TimeTicks& timestamp) {
- // Let AutoComplete know as well.
- autocomplete_history_manager_.OnFormSubmitted(form);
+ // Let Autocomplete know as well.
+ autocomplete_history_manager_->OnFormSubmitted(form);
if (!IsAutofillEnabled())
return false;
@@ -539,7 +540,7 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
// Add the results from AutoComplete. They come back asynchronously, so we
// hand off what we generated and they will send the results back to the
// renderer.
- autocomplete_history_manager_.OnGetAutocompleteSuggestions(
+ autocomplete_history_manager_->OnGetAutocompleteSuggestions(
query_id, field.name, field.value, values, labels, icons, unique_ids);
}
@@ -693,7 +694,7 @@ void AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) {
void AutofillManager::RemoveAutocompleteEntry(const base::string16& name,
const base::string16& value) {
- autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value);
+ autocomplete_history_manager_->OnRemoveAutocompleteEntry(name, value);
}
content::WebContents* AutofillManager::GetWebContents() const {
@@ -965,7 +966,6 @@ AutofillManager::AutofillManager(AutofillDriver* driver,
manager_delegate_(delegate),
app_locale_("en-US"),
personal_data_(personal_data),
- autocomplete_history_manager_(driver),
autocheckout_manager_(this),
metric_logger_(new AutofillMetrics),
has_logged_autofill_enabled_(false),
@@ -977,6 +977,8 @@ AutofillManager::AutofillManager(AutofillDriver* driver,
external_delegate_(NULL),
test_delegate_(NULL),
weak_ptr_factory_(this) {
+ autocomplete_history_manager_.reset(
+ new AutocompleteHistoryManager(driver, delegate));
Ilya Sherman 2013/06/19 00:38:27 nit: Why did this get moved out of the initializer
sgurun-gerrit only 2013/06/19 17:56:23 Done.
DCHECK(driver_);
DCHECK(driver_->GetWebContents());
DCHECK(manager_delegate_);

Powered by Google App Engine
This is Rietveld 408576698