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

Unified Diff: chrome/browser/sync/notifier/sync_notifier.h

Issue 6621062: Refactor sync notifier out of sync api. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Minox fixes. Created 9 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
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | chrome/browser/sync/notifier/sync_notifier_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/notifier/sync_notifier.h
diff --git a/chrome/browser/sync/notifier/sync_notifier.h b/chrome/browser/sync/notifier/sync_notifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..da15259c2b4146e0612388068623bb6cb6f663b2
--- /dev/null
+++ b/chrome/browser/sync/notifier/sync_notifier.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Interface to the sync notifier, which is an object that receives
+// notifications when updates are available for a set of sync types.
+// All the observers are notified when such an event happens.
+
+#ifndef CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_
+#define CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_
+
+#include <string>
+
+#include "chrome/browser/sync/syncable/model_type.h"
+
+namespace sync_notifier {
+class SyncNotifierObserver;
+
+class SyncNotifier {
+ public:
+ SyncNotifier() {}
+ virtual ~SyncNotifier() {}
+
+ virtual void AddObserver(SyncNotifierObserver* observer) = 0;
+ virtual void RemoveObserver(SyncNotifierObserver* observer) = 0;
+
+ // SetState must be called once, before any call to UpdateCredentials.
+ virtual void SetState(const std::string& state) = 0;
+
+ // The observers won't be notified of any notifications until
+ // UpdateCredentials is called at least once. It can be called more than
+ // once.
+ virtual void UpdateCredentials(
+ const std::string& email, const std::string& token) = 0;
+
+ virtual void UpdateEnabledTypes(const syncable::ModelTypeSet& types) = 0;
+
+ // This is here only to support the old p2p notification implementation,
+ // which is still used by sync integration tests.
+ // TODO(akalin): Remove this once we move the integration tests off p2p
+ // notifications.
+ virtual void SendNotification() = 0;
+};
+} // namespace sync_notifier
+
+#endif // CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_
+
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | chrome/browser/sync/notifier/sync_notifier_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698