| Index: components/autofill/browser/autocomplete_history_manager.h
|
| diff --git a/components/autofill/browser/autocomplete_history_manager.h b/components/autofill/browser/autocomplete_history_manager.h
|
| index 9a55fa44b7dfd4cde12625f850f5c9b5f11ab38a..bec877ad9670929651972503ebc425f686285b5c 100644
|
| --- a/components/autofill/browser/autocomplete_history_manager.h
|
| +++ b/components/autofill/browser/autocomplete_history_manager.h
|
| @@ -11,29 +11,26 @@
|
| #include "base/prefs/pref_member.h"
|
| #include "components/autofill/browser/webdata/autofill_webdata_service.h"
|
| #include "components/webdata/common/web_data_service_consumer.h"
|
| -#include "content/public/browser/web_contents_observer.h"
|
|
|
| namespace content {
|
| class BrowserContext;
|
| +class WebContents;
|
| }
|
|
|
| namespace autofill {
|
|
|
| +class AutofillDriver;
|
| class AutofillExternalDelegate;
|
| struct FormData;
|
|
|
| // Per-tab Autocomplete history manager. Handles receiving form data
|
| // from the renderer and the storing and retrieving of form data
|
| // through WebDataServiceBase.
|
| -class AutocompleteHistoryManager : public content::WebContentsObserver,
|
| - public WebDataServiceConsumer {
|
| +class AutocompleteHistoryManager : public WebDataServiceConsumer {
|
| public:
|
| - explicit AutocompleteHistoryManager(content::WebContents* web_contents);
|
| + explicit AutocompleteHistoryManager(AutofillDriver* driver);
|
| virtual ~AutocompleteHistoryManager();
|
|
|
| - // content::WebContentsObserver implementation.
|
| - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| -
|
| // WebDataServiceConsumer implementation.
|
| virtual void OnWebDataServiceRequestDone(
|
| WebDataServiceBase::Handle h,
|
| @@ -64,11 +61,16 @@ class AutocompleteHistoryManager : public content::WebContentsObserver,
|
| // Sends the given |suggestions| for display in the Autofill popup.
|
| void SendSuggestions(const std::vector<base::string16>* suggestions);
|
|
|
| + // Used by tests to disable sending IPC.
|
| + void set_send_ipc(bool send_ipc) { send_ipc_ = send_ipc; }
|
| +
|
| private:
|
| // Cancels the currently pending WebDataService query, if there is one.
|
| void CancelPendingQuery();
|
|
|
| content::BrowserContext* browser_context_;
|
| + // Provides driver-level context. Must outlive this object.
|
| + AutofillDriver* driver_;
|
| scoped_refptr<AutofillWebDataService> autofill_data_;
|
|
|
| BooleanPrefMember autofill_enabled_;
|
| @@ -87,6 +89,9 @@ class AutocompleteHistoryManager : public content::WebContentsObserver,
|
| // our behalf. Weak.
|
| AutofillExternalDelegate* external_delegate_;
|
|
|
| + // Whether IPC is sent.
|
| + bool send_ipc_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager);
|
| };
|
|
|
|
|