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

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

Issue 12476031: Refactor notifications of chrome/browser/webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 0470db96fe0ab7054d1427ad9cee55b95b8d4beb..957181fec6f5befae605cd91334cf01f6c3558e2 100644
--- a/chrome/browser/webdata/autocomplete_syncable_service.h
+++ b/chrome/browser/webdata/autocomplete_syncable_service.h
@@ -12,13 +12,13 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/scoped_observer.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"
#include "chrome/browser/webdata/autofill_web_data_service.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "chrome/browser/webdata/autofill_web_data_service_observer.h"
#include "sync/api/sync_change.h"
#include "sync/api/sync_data.h"
#include "sync/api/sync_error.h"
@@ -38,12 +38,10 @@ class AutofillSpecifics;
// MergeDataAndStartSyncing() called first, it does cloud->local and
// local->cloud syncs. Then for each cloud change we receive
// ProcessSyncChanges() and for each local change Observe() is called.
-// TODO(georgey) : remove reliance on the notifications and make it to be called
-// from web_data_service directly.
class AutocompleteSyncableService
: public base::SupportsUserData::Data,
public syncer::SyncableService,
- public content::NotificationObserver,
+ public AutofillWebDataServiceObserverOnDBThread,
public base::NonThreadSafe {
public:
virtual ~AutocompleteSyncableService();
@@ -70,10 +68,9 @@ class AutocompleteSyncableService
const tracked_objects::Location& from_here,
const syncer::SyncChangeList& change_list) OVERRIDE;
- // NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // AutofillWebDataServiceObserverOnDBThread implementation.
+ virtual void AutofillEntriesChanged(
+ const AutofillChangeList& changes) OVERRIDE;
// Called via sync to tell us if we should cull expired entries when merging
// and/or processing sync changes.
@@ -149,7 +146,8 @@ class AutocompleteSyncableService
// |web_data_service_| passed to it.
AutofillWebDataService* web_data_service_;
- content::NotificationRegistrar notification_registrar_;
+ ScopedObserver<AutofillWebDataService, AutocompleteSyncableService>
+ scoped_observer_;
// We receive ownership of |sync_processor_| in MergeDataAndStartSyncing() and
// destroy it in StopSyncing().

Powered by Google App Engine
This is Rietveld 408576698