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

Unified Diff: components/copresence/public/copresence_observer.h

Issue 764673003: Adding CopresenceState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « components/copresence/public/copresence_manager.h ('k') | components/copresence/public/copresence_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/public/copresence_observer.h
diff --git a/components/copresence/public/copresence_observer.h b/components/copresence/public/copresence_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..1e28726927e53815f46a38f2af352171927db6cc
--- /dev/null
+++ b/components/copresence/public/copresence_observer.h
@@ -0,0 +1,35 @@
+// Copyright 2014 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 COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_OBSERVER_H_
+#define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_OBSERVER_H_
+
+namespace copresence {
+
+class Directive;
+struct TransmittedToken;
+struct ReceivedToken;
+
+// Implement this interface to be notified of changes
+// to the state of the copresence component.
+// TODO(ckehoe): Create a LoggingObserver based on this that replaces
+// equivalent logging elsewhere. Then we know what state is being recorded.
+class CopresenceObserver {
+ public:
+ // Called when the list of active directives has changed.
+ virtual void DirectivesUpdated() = 0;
+
+ // Called when a token is transmitted.
+ virtual void TokenTransmitted(const TransmittedToken& token) = 0;
+
+ // Called when a token is received.
+ virtual void TokenReceived(const ReceivedToken& token) = 0;
+
+ protected:
+ virtual ~CopresenceObserver() {}
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_OBSERVER_H_
« no previous file with comments | « components/copresence/public/copresence_manager.h ('k') | components/copresence/public/copresence_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698