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