| 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 27 matching lines...) Expand all Loading... |
| 84 std::string user_email_; | 87 std::string user_email_; |
| 85 remoting::HostKeyPair key_pair_; | 88 remoting::HostKeyPair key_pair_; |
| 86 std::string host_id_; | 89 std::string host_id_; |
| 87 | 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(HostStarter); | 91 DISALLOW_COPY_AND_ASSIGN(HostStarter); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace remoting | 94 } // namespace remoting |
| 92 | 95 |
| 93 #endif // REMOTING_HOST_HOST_STARTER | 96 #endif // REMOTING_HOST_HOST_STARTER |
| OLD | NEW |