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

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 10805002: [Sync] Enable adding notifier observers from ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head, address comments Created 8 years, 5 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/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index ef5eff0c9382fa1936b18ef0a068a38efb8e531f..3dee74f3a9686fad5632d1a997bac35a9899d7d0 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -38,6 +38,7 @@
#include "sync/internal_api/public/util/experiments.h"
#include "sync/internal_api/public/util/unrecoverable_error_handler.h"
#include "sync/js/sync_js_controller.h"
+#include "sync/notifier/sync_notifier_helper.h"
class Profile;
class ProfileSyncComponentsFactory;
@@ -253,6 +254,14 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
virtual bool HasSyncSetupCompleted() const;
virtual void SetSyncSetupCompleted();
+ // syncer::SyncNotifier implementation (via SyncFrontend).
+ virtual void OnNotificationsEnabled() OVERRIDE;
+ virtual void OnNotificationsDisabled(
+ syncer::NotificationsDisabledReason reason) OVERRIDE;
+ virtual void OnIncomingNotification(
+ const syncer::ObjectIdPayloadMap& id_payloads,
+ syncer::IncomingNotificationSource source) OVERRIDE;
+
// SyncFrontend implementation.
virtual void OnBackendInitialized(
const syncer::WeakHandle<syncer::JsBackend>& js_backend,
@@ -542,6 +551,16 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// been cleared yet. Virtual for testing purposes.
virtual bool waiting_for_auth() const;
+ // Updates the set of ObjectIds associated with a given
+ // |handler|. Passing an empty ObjectIdSet will unregister
+ // |handler|. There should be at most one handler registered per
+ // object id.
+ //
+ // The handler -> registered ids map is persisted across restarts of
+ // sync.
+ void UpdateRegisteredInvalidationIds(syncer::SyncNotifierObserver* handler,
+ const syncer::ObjectIdSet& ids);
+
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
@@ -816,6 +835,12 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// Factory the backend will use to build the SyncManager.
syncer::SyncManagerFactory sync_manager_factory_;
+ // The set of all registered IDs.
+ syncer::ObjectIdSet all_registered_ids_;
+
+ // Dispatches invalidations to handlers.
+ syncer::SyncNotifierHelper notifier_helper_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
};

Powered by Google App Engine
This is Rietveld 408576698