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

Unified Diff: jingle/notifier/listener/push_client_observer.h

Issue 10413014: [Sync] Turn notifier::PushClient into an interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 8 years, 7 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 | « jingle/notifier/listener/push_client.cc ('k') | jingle/notifier/listener/push_client_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/push_client_observer.h
diff --git a/jingle/notifier/listener/push_client_observer.h b/jingle/notifier/listener/push_client_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..0fe7d467295746bca2689611847c06a7cd4575eb
--- /dev/null
+++ b/jingle/notifier/listener/push_client_observer.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 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.
+
+#ifndef JINGLE_NOTIFIER_LISTENER_NON_BLOCKING_PUSH_CLIENT_OBSERVER_H_
+#define JINGLE_NOTIFIER_LISTENER_NON_BLOCKING_PUSH_CLIENT_OBSERVER_H_
+
+#include "jingle/notifier/listener/notification_defines.h"
+
+namespace notifier {
+
+// A PushClientObserver is notified whenever an incoming notification
+// is received or when the state of the push client changes.
+class PushClientObserver {
+ protected:
+ virtual ~PushClientObserver();
+
+ public:
+ // Called when the state of the push client changes. If
+ // |notifications_enabled| is true, that means notifications can be
+ // sent and received freely. If it is false, that means no
+ // notifications can be sent or received.
+ virtual void OnNotificationStateChange(bool notifications_enabled) = 0;
+
+ // Called when a notification is received. The details of the
+ // notification are in |notification|.
+ virtual void OnIncomingNotification(const Notification& notification) = 0;
+};
+
+} // namespace notifier
+
+#endif // JINGLE_NOTIFIER_LISTENER_NON_BLOCKING_PUSH_CLIENT_OBSERVER_H_
« no previous file with comments | « jingle/notifier/listener/push_client.cc ('k') | jingle/notifier/listener/push_client_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698