Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / copresence / public / copresence_manager.h
blobd08ba49df87b97693f561315c70526ad14d2db1f
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.
5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
8 #include <string>
10 #include "components/copresence/public/copresence_delegate.h"
12 namespace copresence {
14 class CopresenceState;
15 class ReportRequest;
17 // The CopresenceManager class is the central interface for Copresence
18 // functionality. This class handles all the initialization and delegation
19 // of copresence tasks. Any user of copresence only needs to interact
20 // with this class.
21 class CopresenceManager {
22 public:
23 CopresenceManager() {}
24 virtual ~CopresenceManager() {}
26 // Accessor for the CopresenceState instance that tracks debug info.
27 virtual CopresenceState* state() = 0;
29 // This method will execute a report request. Each report request can have
30 // multiple (un)publishes, (un)subscribes. This will ensure that once the
31 // manager is initialized, it sends all request to the server and handles
32 // the response. If an error is encountered, the status callback is used
33 // to relay it to the requester.
34 virtual void ExecuteReportRequest(const ReportRequest& request,
35 const std::string& app_id,
36 const std::string& auth_token,
37 const StatusCallback& callback) = 0;
39 private:
40 DISALLOW_COPY_AND_ASSIGN(CopresenceManager);
43 } // namespace copresence
45 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_