Index: components/autofill/core/browser/autocomplete_history_manager.cc |
diff --git a/components/autofill/core/browser/autocomplete_history_manager.cc b/components/autofill/core/browser/autocomplete_history_manager.cc |
index 2c3042764e87305290a529bb1655570e899676ea..4267990244b15e9a11c98640b387a104e7a4023b 100644 |
--- a/components/autofill/core/browser/autocomplete_history_manager.cc |
+++ b/components/autofill/core/browser/autocomplete_history_manager.cc |
@@ -16,11 +16,6 @@ |
#include "components/autofill/core/common/autofill_messages.h" |
#include "components/autofill/core/common/autofill_pref_names.h" |
#include "components/autofill/core/common/form_data.h" |
-#include "content/public/browser/browser_context.h" |
-#include "content/public/browser/web_contents.h" |
- |
-using content::BrowserContext; |
-using content::WebContents; |
namespace autofill { |
namespace { |
@@ -43,10 +38,8 @@ bool IsTextField(const FormFieldData& field) { |
AutocompleteHistoryManager::AutocompleteHistoryManager( |
AutofillDriver* driver, |
AutofillManagerDelegate* manager_delegate) |
- : browser_context_(driver->GetWebContents()->GetBrowserContext()), |
- driver_(driver), |
- autofill_data_( |
- AutofillWebDataService::FromBrowserContext(browser_context_)), |
+ : driver_(driver), |
+ database_(manager_delegate->GetDatabase()), |
pending_query_handle_(0), |
query_id_(0), |
external_delegate_(NULL), |
@@ -106,8 +99,8 @@ void AutocompleteHistoryManager::OnGetAutocompleteSuggestions( |
return; |
} |
- if (autofill_data_.get()) { |
- pending_query_handle_ = autofill_data_->GetFormValuesForElementName( |
+ if (database_.get()) { |
+ pending_query_handle_ = database_->GetFormValuesForElementName( |
name, prefix, kMaxAutocompleteMenuItems, this); |
} |
} |
@@ -142,14 +135,14 @@ void AutocompleteHistoryManager::OnFormSubmitted(const FormData& form) { |
} |
} |
- if (!values.empty() && autofill_data_.get()) |
- autofill_data_->AddFormFields(values); |
+ if (!values.empty() && database_.get()) |
+ database_->AddFormFields(values); |
} |
void AutocompleteHistoryManager::OnRemoveAutocompleteEntry( |
const base::string16& name, const base::string16& value) { |
- if (autofill_data_.get()) |
- autofill_data_->RemoveFormValueForElementName(name, value); |
+ if (database_.get()) |
+ database_->RemoveFormValueForElementName(name, value); |
} |
void AutocompleteHistoryManager::SetExternalDelegate( |
@@ -159,8 +152,8 @@ void AutocompleteHistoryManager::SetExternalDelegate( |
void AutocompleteHistoryManager::CancelPendingQuery() { |
if (pending_query_handle_) { |
- if (autofill_data_.get()) |
- autofill_data_->CancelRequest(pending_query_handle_); |
+ if (database_.get()) |
+ database_->CancelRequest(pending_query_handle_); |
pending_query_handle_ = 0; |
} |
} |