OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_ | |
6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "components/copresence/public/copresence_delegate.h" | |
12 | |
13 namespace copresence { | |
14 | |
15 class CopresenceState; | |
16 class ReportRequest; | |
17 | |
18 // The CopresenceManager class is the central interface for Copresence | |
19 // functionality. This class handles all the initialization and delegation | |
20 // of copresence tasks. Any user of copresence only needs to interact | |
21 // with this class. | |
22 class CopresenceManager { | |
23 public: | |
24 CopresenceManager() {} | |
25 virtual ~CopresenceManager() {} | |
26 | |
27 // Accessor for the CopresenceState instance that tracks debug info. | |
28 virtual CopresenceState* state() = 0; | |
29 | |
30 // This method will execute a report request. Each report request can have | |
31 // multiple (un)publishes, (un)subscribes. This will ensure that once the | |
32 // manager is initialized, it sends all request to the server and handles | |
33 // the response. If an error is encountered, the status callback is used | |
34 // to relay it to the requester. | |
35 virtual void ExecuteReportRequest(const ReportRequest& request, | |
36 const std::string& app_id, | |
37 const std::string& auth_token, | |
38 const StatusCallback& callback) = 0; | |
39 | |
40 private: | |
41 DISALLOW_COPY_AND_ASSIGN(CopresenceManager); | |
42 }; | |
43 | |
44 } // namespace copresence | |
45 | |
46 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_ | |
OLD | NEW |