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 #include "remoting/host/setup/host_starter.h" | 5 #include "remoting/host/setup/host_starter.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 consent_to_data_collection_(false), | 27 consent_to_data_collection_(false), |
28 weak_ptr_factory_(this), | 28 weak_ptr_factory_(this), |
29 weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { | 29 weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { |
30 main_task_runner_ = base::ThreadTaskRunnerHandle::Get(); | 30 main_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
31 } | 31 } |
32 | 32 |
33 HostStarter::~HostStarter() { | 33 HostStarter::~HostStarter() { |
34 } | 34 } |
35 | 35 |
36 scoped_ptr<HostStarter> HostStarter::Create( | 36 scoped_ptr<HostStarter> HostStarter::Create( |
37 const std::string& oauth2_token_url, | |
38 const std::string& chromoting_hosts_url, | 37 const std::string& chromoting_hosts_url, |
39 net::URLRequestContextGetter* url_request_context_getter) { | 38 net::URLRequestContextGetter* url_request_context_getter) { |
40 scoped_ptr<gaia::GaiaOAuthClient> oauth_client( | 39 scoped_ptr<gaia::GaiaOAuthClient> oauth_client( |
41 new gaia::GaiaOAuthClient( | 40 new gaia::GaiaOAuthClient(url_request_context_getter)); |
42 oauth2_token_url, url_request_context_getter)); | |
43 scoped_ptr<remoting::ServiceClient> service_client( | 41 scoped_ptr<remoting::ServiceClient> service_client( |
44 new remoting::ServiceClient( | 42 new remoting::ServiceClient( |
45 chromoting_hosts_url, url_request_context_getter)); | 43 chromoting_hosts_url, url_request_context_getter)); |
46 scoped_ptr<remoting::DaemonController> daemon_controller( | 44 scoped_ptr<remoting::DaemonController> daemon_controller( |
47 remoting::DaemonController::Create()); | 45 remoting::DaemonController::Create()); |
48 return scoped_ptr<HostStarter>( | 46 return scoped_ptr<HostStarter>( |
49 new HostStarter(oauth_client.Pass(), service_client.Pass(), | 47 new HostStarter(oauth_client.Pass(), service_client.Pass(), |
50 daemon_controller.Pass())); | 48 daemon_controller.Pass())); |
51 } | 49 } |
52 | 50 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 main_task_runner_->PostTask(FROM_HERE, base::Bind( | 173 main_task_runner_->PostTask(FROM_HERE, base::Bind( |
176 &HostStarter::OnHostUnregistered, weak_ptr_)); | 174 &HostStarter::OnHostUnregistered, weak_ptr_)); |
177 return; | 175 return; |
178 } | 176 } |
179 CompletionCallback cb = on_done_; | 177 CompletionCallback cb = on_done_; |
180 on_done_.Reset(); | 178 on_done_.Reset(); |
181 cb.Run(START_ERROR); | 179 cb.Run(START_ERROR); |
182 } | 180 } |
183 | 181 |
184 } // namespace remoting | 182 } // namespace remoting |
OLD | NEW |