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

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

Issue 441103002: Tests for the Copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api
Patch Set: Renaming to simply CopresenceDelegate Created 6 years, 4 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 | « components/copresence/public/copresence_delegate.h ('k') | components/copresence/rpc/rpc_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/public/copresence_manager.h
diff --git a/components/copresence/public/copresence_manager.h b/components/copresence/public/copresence_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae7f14cc98bed528fd5fad876e53ac455e0a72af
--- /dev/null
+++ b/components/copresence/public/copresence_manager.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_MANAGER_H_
+#define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "components/copresence/public/copresence_delegate.h"
+
+namespace copresence {
+
+class ReportRequest;
+
+// The CopresenceManager class is the central interface for Copresence
+// functionality. This class handles all the initialization and delegation
+// of copresence tasks. Any user of copresence only needs to interact
+// with this class.
+class CopresenceManager {
+ public:
+ CopresenceManager() {}
+ virtual ~CopresenceManager() {}
+
+ // This method will execute a report request. Each report request can have
+ // multiple (un)publishes, (un)subscribes. This will ensure that once the
+ // manager is initialized, it sends all request to the server and handles
+ // the response. If an error is encountered, the status callback is used
+ // to relay it to the requester.
+ virtual void ExecuteReportRequest(ReportRequest request,
+ const std::string& app_id,
+ const StatusCallback& callback) = 0;
+
+ // Factory method for CopresenceManagers. The delegate is owned
+ // by the caller, and must outlive the manager.
+ static scoped_ptr<CopresenceManager> Create(CopresenceDelegate* delegate);
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(CopresenceManager);
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
« no previous file with comments | « components/copresence/public/copresence_delegate.h ('k') | components/copresence/rpc/rpc_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698