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 15 matching lines...) Expand all Loading... |
26 OAUTH_ERROR, | 26 OAUTH_ERROR, |
27 START_ERROR, | 27 START_ERROR, |
28 }; | 28 }; |
29 | 29 |
30 typedef base::Callback<void(Result)> CompletionCallback; | 30 typedef base::Callback<void(Result)> CompletionCallback; |
31 | 31 |
32 virtual ~HostStarter(); | 32 virtual ~HostStarter(); |
33 | 33 |
34 // Creates a HostStarter. | 34 // Creates a HostStarter. |
35 static scoped_ptr<HostStarter> Create( | 35 static scoped_ptr<HostStarter> Create( |
36 const std::string& oauth2_token_url, | |
37 const std::string& chromoting_hosts_url, | 36 const std::string& chromoting_hosts_url, |
38 net::URLRequestContextGetter* url_request_context_getter); | 37 net::URLRequestContextGetter* url_request_context_getter); |
39 | 38 |
40 // Registers a new host with the Chromoting service, and starts it. | 39 // Registers a new host with the Chromoting service, and starts it. |
41 // |auth_code| must be a valid OAuth2 authorization code, typically acquired | 40 // |auth_code| must be a valid OAuth2 authorization code, typically acquired |
42 // from a browser. This method uses that code to get an OAuth2 refresh token. | 41 // from a browser. This method uses that code to get an OAuth2 refresh token. |
43 void StartHost(const std::string& host_name, | 42 void StartHost(const std::string& host_name, |
44 const std::string& host_pin, | 43 const std::string& host_pin, |
45 bool consent_to_data_collection, | 44 bool consent_to_data_collection, |
46 const std::string& auth_code, | 45 const std::string& auth_code, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 89 |
91 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; | 90 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; |
92 base::WeakPtr<HostStarter> weak_ptr_; | 91 base::WeakPtr<HostStarter> weak_ptr_; |
93 | 92 |
94 DISALLOW_COPY_AND_ASSIGN(HostStarter); | 93 DISALLOW_COPY_AND_ASSIGN(HostStarter); |
95 }; | 94 }; |
96 | 95 |
97 } // namespace remoting | 96 } // namespace remoting |
98 | 97 |
99 #endif // REMOTING_HOST_HOST_STARTER | 98 #endif // REMOTING_HOST_HOST_STARTER |
OLD | NEW |