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

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: Fixing overzealous DCHECK 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
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..af064a11a441cc22ba36b1610e2c9f34552c72d1
--- /dev/null
+++ b/components/copresence/public/copresence_observer.h
@@ -0,0 +1,44 @@
+// 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_
+
+#include <map>
+#include <string>
+#include <vector>
xiyuan 2014/12/18 18:10:52 nit: The above 3 headers seems not used.
Charlie 2014/12/19 03:53:33 Done.
+
+#include "base/macros.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:
+ CopresenceObserver() {}
+ virtual ~CopresenceObserver() {}
+
+ // 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;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CopresenceObserver);
xiyuan 2014/12/18 18:10:52 nit: usually we don't use DISALLOW_COPY_AND_ASSIGN
Charlie 2014/12/19 03:53:33 Done.
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698