| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_SERVICE_CLIENT_H_ | 5 #ifndef REMOTING_HOST_SERVICE_CLIENT_H_ |
| 6 #define REMOTING_HOST_SERVICE_CLIENT_H_ | 6 #define REMOTING_HOST_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 virtual void OnHostUnregistered() = 0; | 27 virtual void OnHostUnregistered() = 0; |
| 28 // Invoked when there is an OAuth error. | 28 // Invoked when there is an OAuth error. |
| 29 virtual void OnOAuthError() = 0; | 29 virtual void OnOAuthError() = 0; |
| 30 // Invoked when there is a network error or upon receiving an invalid | 30 // Invoked when there is a network error or upon receiving an invalid |
| 31 // response. | 31 // response. |
| 32 virtual void OnNetworkError(int response_code) = 0; | 32 virtual void OnNetworkError(int response_code) = 0; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
| 36 }; | 36 }; |
| 37 ServiceClient(net::URLRequestContextGetter* context_getter); | 37 explicit ServiceClient(net::URLRequestContextGetter* context_getter); |
| 38 ~ServiceClient(); | 38 ~ServiceClient(); |
| 39 | 39 |
| 40 // Register a host. | 40 // Register a host. |
| 41 void RegisterHost(const std::string& host_id, | 41 void RegisterHost(const std::string& host_id, |
| 42 const std::string& host_name, | 42 const std::string& host_name, |
| 43 const std::string& public_key, | 43 const std::string& public_key, |
| 44 const std::string& oauth_access_token, | 44 const std::string& oauth_access_token, |
| 45 Delegate* delegate); | 45 Delegate* delegate); |
| 46 // Unregister a host. | 46 // Unregister a host. |
| 47 void UnregisterHost(const std::string& host_id, | 47 void UnregisterHost(const std::string& host_id, |
| 48 const std::string& oauth_access_token, | 48 const std::string& oauth_access_token, |
| 49 Delegate* delegate); | 49 Delegate* delegate); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // The guts of the implementation live in this class. | 52 // The guts of the implementation live in this class. |
| 53 class Core; | 53 class Core; |
| 54 scoped_refptr<Core> core_; | 54 scoped_refptr<Core> core_; |
| 55 DISALLOW_COPY_AND_ASSIGN(ServiceClient); | 55 DISALLOW_COPY_AND_ASSIGN(ServiceClient); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace remoting | 58 } // namespace remoting |
| 59 | 59 |
| 60 #endif // REMOTING_HOST_SERVICE_CLIENT_H_ | 60 #endif // REMOTING_HOST_SERVICE_CLIENT_H_ |
| OLD | NEW |