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

Unified Diff: chrome/browser/webdata/autocomplete_syncable_service.h

Issue 12695015: Split Autofill webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: chrome/browser/webdata/autocomplete_syncable_service.h
diff --git a/chrome/browser/webdata/autocomplete_syncable_service.h b/chrome/browser/webdata/autocomplete_syncable_service.h
index 3a0a5c9cd90f4b25fdf3f7c6b8901b93a2932286..5b1b91e2a1c57fb4ca50d3a4b528298187514c9a 100644
--- a/chrome/browser/webdata/autocomplete_syncable_service.h
+++ b/chrome/browser/webdata/autocomplete_syncable_service.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/supports_user_data.h"
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/autofill_entry.h"
@@ -40,13 +41,23 @@ class AutofillSpecifics;
// TODO(georgey) : remove reliance on the notifications and make it to be called
// from web_data_service directly.
class AutocompleteSyncableService
- : public syncer::SyncableService,
+ : public base::SupportsUserData::Data,
+ public syncer::SyncableService,
public content::NotificationObserver,
public base::NonThreadSafe {
public:
- explicit AutocompleteSyncableService(WebDataService* web_data_service);
virtual ~AutocompleteSyncableService();
+ // TODO(joi): Change this to key off AutofillWebDataService instead
+ // of WebDataService, once it is truly separate.
+
+ // Creates a new AutocompleteSyncableService and hangs it off of
+ // |web_data|, which takes ownership.
+ static void CreateForWebDataService(WebDataService* web_data);
+ // Retrieves the AutocompleteSyncableService stored on |web_data|.
+ static AutocompleteSyncableService* FromWebDataService(
+ WebDataService* web_data);
+
static syncer::ModelType model_type() { return syncer::AUTOFILL; }
// syncer::SyncableService implementation.
@@ -73,6 +84,8 @@ class AutocompleteSyncableService
bool cull_expired_entries() const { return cull_expired_entries_; }
protected:
+ explicit AutocompleteSyncableService(WebDataService* web_data_service);
+
// Helper to query WebDatabase for the current autocomplete state.
// Made virtual for ease of mocking in the unit-test.
virtual bool LoadAutofillData(std::vector<AutofillEntry>* entries) const;

Powered by Google App Engine
This is Rietveld 408576698