1 // Copyright 2013 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 REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
6 #define REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
10 #include "base/memory/ref_counted.h"
13 class URLRequestContextGetter;
16 // A class that gives access to the Chromoting service.
21 // TODO(simonmorris): Consider using a Callback instead of a delegate.
24 // Invoked when a host has been registered.
25 virtual void OnHostRegistered(const std::string& authorization_code) = 0;
26 // Invoked when a host has been unregistered.
27 virtual void OnHostUnregistered() = 0;
28 // Invoked when there is an OAuth error.
29 virtual void OnOAuthError() = 0;
30 // Invoked when there is a network error or upon receiving an invalid
32 virtual void OnNetworkError(int response_code) = 0;
35 virtual ~Delegate() {}
37 ServiceClient(const std::string& chromoting_hosts_url,
38 net::URLRequestContextGetter* context_getter);
42 void RegisterHost(const std::string& host_id,
43 const std::string& host_name,
44 const std::string& public_key,
45 const std::string& host_client_id,
46 const std::string& oauth_access_token,
49 void UnregisterHost(const std::string& host_id,
50 const std::string& oauth_access_token,
54 // The guts of the implementation live in this class.
56 scoped_refptr<Core> core_;
57 DISALLOW_COPY_AND_ASSIGN(ServiceClient);
60 } // namespace remoting
62 #endif // REMOTING_HOST_SETUP_SERVICE_CLIENT_H_