| 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_HOST_STARTER | 5 #ifndef REMOTING_HOST_HOST_STARTER |
| 6 #define REMOTING_HOST_HOST_STARTER | 6 #define REMOTING_HOST_HOST_STARTER |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 virtual ~HostStarter(); | 36 virtual ~HostStarter(); |
| 37 | 37 |
| 38 // Creates a HostStarter. | 38 // Creates a HostStarter. |
| 39 static scoped_ptr<HostStarter> Create( | 39 static scoped_ptr<HostStarter> Create( |
| 40 net::URLRequestContextGetter* url_request_context_getter); | 40 net::URLRequestContextGetter* url_request_context_getter); |
| 41 | 41 |
| 42 // Registers a new host with the Chromoting service, and starts it. | 42 // Registers a new host with the Chromoting service, and starts it. |
| 43 // |auth_code| must be a valid OAuth2 authorization code, typically acquired | 43 // |auth_code| must be a valid OAuth2 authorization code, typically acquired |
| 44 // from a browser. This method uses that code to get an OAuth2 refresh token. | 44 // from a browser. This method uses that code to get an OAuth2 refresh token. |
| 45 void StartHost(const std::string& host_name, const std::string& host_pin, | 45 void StartHost(const std::string& host_name, |
| 46 bool consent_to_data_collection, const std::string& auth_code, | 46 const std::string& host_pin, |
| 47 bool consent_to_data_collection, |
| 48 const std::string& auth_code, |
| 49 const std::string& redirect_url, |
| 47 CompletionCallback on_done); | 50 CompletionCallback on_done); |
| 48 | 51 |
| 49 // gaia::GaiaOAuthClient::Delegate | 52 // gaia::GaiaOAuthClient::Delegate |
| 50 virtual void OnGetTokensResponse(const std::string& refresh_token, | 53 virtual void OnGetTokensResponse(const std::string& refresh_token, |
| 51 const std::string& access_token, | 54 const std::string& access_token, |
| 52 int expires_in_seconds) OVERRIDE; | 55 int expires_in_seconds) OVERRIDE; |
| 53 virtual void OnRefreshTokenResponse(const std::string& access_token, | 56 virtual void OnRefreshTokenResponse(const std::string& access_token, |
| 54 int expires_in_seconds) OVERRIDE; | 57 int expires_in_seconds) OVERRIDE; |
| 55 virtual void OnOAuthError() OVERRIDE; | 58 virtual void OnOAuthError() OVERRIDE; |
| 56 virtual void OnNetworkError(int response_code) OVERRIDE; | 59 virtual void OnNetworkError(int response_code) OVERRIDE; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 91 |
| 89 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; | 92 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; |
| 90 base::WeakPtr<HostStarter> weak_ptr_; | 93 base::WeakPtr<HostStarter> weak_ptr_; |
| 91 | 94 |
| 92 DISALLOW_COPY_AND_ASSIGN(HostStarter); | 95 DISALLOW_COPY_AND_ASSIGN(HostStarter); |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 } // namespace remoting | 98 } // namespace remoting |
| 96 | 99 |
| 97 #endif // REMOTING_HOST_HOST_STARTER | 100 #endif // REMOTING_HOST_HOST_STARTER |
| OLD | NEW |