#ifndef REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
#define REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
#include <string>
#include "base/memory/scoped_refptr.h"
namespace network {
class SharedURLLoaderFactory;
}
namespace remoting {
class ServiceClient {
public:
class Delegate {
public:
virtual void OnHostRegistered(const std::string& authorization_code) = 0;
virtual void OnHostUnregistered() = 0;
virtual void OnOAuthError() = 0;
virtual void OnNetworkError(int response_code) = 0;
protected:
virtual ~Delegate() {}
};
explicit ServiceClient(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
ServiceClient(const ServiceClient&) = delete;
ServiceClient& operator=(const ServiceClient&) = delete;
~ServiceClient();
void RegisterHost(const std::string& host_id,
const std::string& host_name,
const std::string& public_key,
const std::string& host_client_id,
const std::string& oauth_access_token,
Delegate* delegate);
void UnregisterHost(const std::string& host_id,
const std::string& oauth_access_token,
Delegate* delegate);
private:
class Core;
scoped_refptr<Core> core_;
};
}
#endif