Chromium Code Reviews| Index: components/autofill/browser/autocomplete_history_manager.cc |
| diff --git a/components/autofill/browser/autocomplete_history_manager.cc b/components/autofill/browser/autocomplete_history_manager.cc |
| index ca7988903017a7794f60d350d21b9ff1364b68b7..a0f9daa0eae601a6835810fa7c9c8c02791453d1 100644 |
| --- a/components/autofill/browser/autocomplete_history_manager.cc |
| +++ b/components/autofill/browser/autocomplete_history_manager.cc |
| @@ -18,6 +18,7 @@ |
| #include "content/public/browser/browser_context.h" |
| #include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "ipc/ipc_message_macros.h" |
| using content::BrowserContext; |
| using content::WebContents; |
| @@ -43,13 +44,14 @@ bool IsTextField(const FormFieldData& field) { |
| AutocompleteHistoryManager::AutocompleteHistoryManager( |
| WebContents* web_contents) |
| - : content::WebContentsObserver(web_contents), |
| - browser_context_(web_contents->GetBrowserContext()), |
| + : browser_context_(web_contents->GetBrowserContext()), |
| + web_contents_(web_contents), |
| autofill_data_( |
| AutofillWebDataService::FromBrowserContext(browser_context_)), |
| pending_query_handle_(0), |
| query_id_(0), |
| - external_delegate_(NULL) { |
| + external_delegate_(NULL), |
| + send_IPC_(true) { |
| autofill_enabled_.Init( |
| prefs::kAutofillEnabled, |
| components::UserPrefs::Get(browser_context_)); |
| @@ -59,17 +61,6 @@ AutocompleteHistoryManager::~AutocompleteHistoryManager() { |
| CancelPendingQuery(); |
| } |
| -bool AutocompleteHistoryManager::OnMessageReceived( |
| - const IPC::Message& message) { |
| - bool handled = true; |
| - IPC_BEGIN_MESSAGE_MAP(AutocompleteHistoryManager, message) |
| - IPC_MESSAGE_HANDLER(AutofillHostMsg_RemoveAutocompleteEntry, |
| - OnRemoveAutocompleteEntry) |
| - IPC_MESSAGE_UNHANDLED(handled = false) |
| - IPC_END_MESSAGE_MAP() |
| - return handled; |
| -} |
| - |
| void AutocompleteHistoryManager::OnWebDataServiceRequestDone( |
| WebDataServiceBase::Handle h, |
| const WDTypedResult* result) { |
| @@ -206,13 +197,14 @@ void AutocompleteHistoryManager::SendSuggestions( |
| autofill_labels_, |
| autofill_icons_, |
| autofill_unique_ids_); |
| - } else { |
| - Send(new AutofillMsg_SuggestionsReturned(routing_id(), |
| - query_id_, |
| - autofill_values_, |
| - autofill_labels_, |
| - autofill_icons_, |
| - autofill_unique_ids_)); |
| + } else if (send_IPC_) { |
| + web_contents_->Send( |
| + new AutofillMsg_SuggestionsReturned(web_contents_->GetRoutingID(), |
| + query_id_, |
| + autofill_values_, |
| + autofill_labels_, |
| + autofill_icons_, |
| + autofill_unique_ids_)); |
|
Ilya Sherman
2013/06/05 10:50:02
Hmm, why isn't this being handled by the AutofillD
blundell
2013/06/11 15:35:47
The goal of this CL is just to remove the need of
|
| } |
| query_id_ = 0; |