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

Unified Diff: components/autofill/browser/autocomplete_history_manager.h

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to review of PS #6 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
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/browser/autocomplete_history_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e6b40c9bd67d961abf3b4f86d9fcdbed151c316c 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_;
+ // Sets whether IPC is sent.
Ilya Sherman 2013/06/14 23:22:24 nit: Omit "Sets", so just "Whether IPC is sent."
blundell 2013/06/15 12:52:32 Done.
+ bool send_ipc_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager);
};
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/browser/autocomplete_history_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698