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 "base/memory/scoped_ptr.h"
9 #include "components/copresence/public/copresence_delegate.h"
11 namespace copresence
{
15 // The CopresenceManager class is the central interface for Copresence
16 // functionality. This class handles all the initialization and delegation
17 // of copresence tasks. Any user of copresence only needs to interact
19 class CopresenceManager
{
21 CopresenceManager() {}
22 virtual ~CopresenceManager() {}
24 // This method will execute a report request. Each report request can have
25 // multiple (un)publishes, (un)subscribes. This will ensure that once the
26 // manager is initialized, it sends all request to the server and handles
27 // the response. If an error is encountered, the status callback is used
28 // to relay it to the requester.
29 virtual void ExecuteReportRequest(ReportRequest request
,
30 const std::string
& app_id
,
31 const StatusCallback
& callback
) = 0;
33 // Factory method for CopresenceManagers. The delegate is owned
34 // by the caller, and must outlive the manager.
35 static scoped_ptr
<CopresenceManager
> Create(CopresenceDelegate
* delegate
);
39 DISALLOW_COPY_AND_ASSIGN(CopresenceManager
);
42 } // namespace copresence
44 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_