| Index: components/copresence/public/copresence_manager.h
|
| diff --git a/components/copresence/public/copresence_manager.h b/components/copresence/public/copresence_manager.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..aa408bc9c8a4a7546752b01a18f26e0929925151
|
| --- /dev/null
|
| +++ b/components/copresence/public/copresence_manager.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
|
| +#define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "components/copresence/public/copresence_manager_delegate.h"
|
| +
|
| +namespace copresence {
|
| +
|
| +class ReportRequest;
|
| +
|
| +// The CopresenceManager class is the central interface for Copresence
|
| +// functionality. This class handles all the initialization and delegation
|
| +// of copresence tasks. Any user of copresence only needs to interact
|
| +// with this class.
|
| +class CopresenceManager {
|
| + public:
|
| + CopresenceManager() {}
|
| + virtual ~CopresenceManager() {}
|
| +
|
| + // This method will execute a report request. Each report request can have
|
| + // multiple (un)publishes, (un)subscribes. This will ensure that once the
|
| + // manager is initialized, it sends all request to the server and handles
|
| + // the response. If an error is encountered, the status callback is used
|
| + // to relay it to the requester.
|
| + virtual void ExecuteReportRequest(ReportRequest request,
|
| + const std::string& app_id,
|
| + const StatusCallback& callback) = 0;
|
| +
|
| + // Factory method for CopresenceManagers. The delegate is owned
|
| + // by the caller, and must outlive the manager.
|
| + static scoped_ptr<CopresenceManager> Create(
|
| + CopresenceManagerDelegate* delegate);
|
| +
|
| + private:
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CopresenceManager);
|
| +};
|
| +
|
| +} // namespace copresence
|
| +
|
| +#endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_MANAGER_H_
|
|
|