Chromium Code Reviews| 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..7e5f149fd6b812ba5526a26a245929f288f28841 100644 |
| --- a/components/autofill/browser/autocomplete_history_manager.h |
| +++ b/components/autofill/browser/autocomplete_history_manager.h |
| @@ -11,10 +11,10 @@ |
| #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 { |
| @@ -25,15 +25,11 @@ 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); |
| virtual ~AutocompleteHistoryManager(); |
| - // content::WebContentsObserver implementation. |
| - virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| - |
| // WebDataServiceConsumer implementation. |
| virtual void OnWebDataServiceRequestDone( |
| WebDataServiceBase::Handle h, |
| @@ -60,15 +56,18 @@ class AutocompleteHistoryManager : public content::WebContentsObserver, |
| protected: |
| friend class AutofillManagerTest; |
| + FRIEND_TEST_ALL_PREFIXES(AutocompleteHistoryManagerTest, ExternalDelegate); |
|
Ilya Sherman
2013/06/05 10:50:02
Why is this needed?
blundell
2013/06/11 15:35:47
To disable sending IPC. Previously a custom subcla
Ilya Sherman
2013/06/12 00:07:46
Using a custom subclass is preferable, as it expos
blundell
2013/06/12 16:29:37
Done.
|
| // Sends the given |suggestions| for display in the Autofill popup. |
| void SendSuggestions(const std::vector<base::string16>* suggestions); |
| private: |
| + |
|
Ilya Sherman
2013/06/05 10:50:02
nit: Spurious blank line.
blundell
2013/06/11 15:35:47
Done.
|
| // Cancels the currently pending WebDataService query, if there is one. |
| void CancelPendingQuery(); |
| content::BrowserContext* browser_context_; |
| + content::WebContents* web_contents_; |
| scoped_refptr<AutofillWebDataService> autofill_data_; |
| BooleanPrefMember autofill_enabled_; |
| @@ -87,6 +86,9 @@ class AutocompleteHistoryManager : public content::WebContentsObserver, |
| // our behalf. Weak. |
| AutofillExternalDelegate* external_delegate_; |
| + // Used by tests to disable sending IPC. |
| + bool send_IPC_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager); |
| }; |