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; | |
16 class ReportRequest; | 15 class ReportRequest; |
17 | 16 |
18 // The CopresenceManager class is the central interface for Copresence | 17 // The CopresenceManager class is the central interface for Copresence |
19 // functionality. This class handles all the initialization and delegation | 18 // functionality. This class handles all the initialization and delegation |
20 // of copresence tasks. Any user of copresence only needs to interact | 19 // of copresence tasks. Any user of copresence only needs to interact |
21 // with this class. | 20 // with this class. |
22 class CopresenceManager { | 21 class CopresenceManager { |
23 public: | 22 public: |
24 CopresenceManager() {} | 23 CopresenceManager() {} |
25 virtual ~CopresenceManager() {} | 24 virtual ~CopresenceManager() {} |
26 | 25 |
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 | 26 // This method will execute a report request. Each report request can have |
31 // multiple (un)publishes, (un)subscribes. This will ensure that once the | 27 // multiple (un)publishes, (un)subscribes. This will ensure that once the |
32 // manager is initialized, it sends all request to the server and handles | 28 // 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 | 29 // the response. If an error is encountered, the status callback is used |
34 // to relay it to the requester. | 30 // to relay it to the requester. |
35 virtual void ExecuteReportRequest(const ReportRequest& request, | 31 virtual void ExecuteReportRequest(const ReportRequest& request, |
36 const std::string& app_id, | 32 const std::string& app_id, |
37 const std::string& auth_token, | 33 const std::string& auth_token, |
38 const StatusCallback& callback) = 0; | 34 const StatusCallback& callback) = 0; |
39 | 35 |
40 private: | 36 private: |
41 DISALLOW_COPY_AND_ASSIGN(CopresenceManager); | 37 DISALLOW_COPY_AND_ASSIGN(CopresenceManager); |
42 }; | 38 }; |
43 | 39 |
44 } // namespace copresence | 40 } // namespace copresence |
45 | 41 |
46 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_ | 42 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_ |
OLD | NEW |