| 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/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "remoting/base/capabilities.h" | 8 #include "remoting/base/capabilities.h" |
| 9 #include "remoting/client/audio_decode_scheduler.h" | 9 #include "remoting/client/audio_decode_scheduler.h" |
| 10 #include "remoting/client/audio_player.h" | 10 #include "remoting/client/audio_player.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 ChromotingClient::~ChromotingClient() { | 50 ChromotingClient::~ChromotingClient() { |
| 51 } | 51 } |
| 52 | 52 |
| 53 void ChromotingClient::Start( | 53 void ChromotingClient::Start( |
| 54 scoped_refptr<XmppProxy> xmpp_proxy, | 54 scoped_refptr<XmppProxy> xmpp_proxy, |
| 55 scoped_ptr<protocol::TransportFactory> transport_factory) { | 55 scoped_ptr<protocol::TransportFactory> transport_factory) { |
| 56 DCHECK(task_runner_->BelongsToCurrentThread()); | 56 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 57 | 57 |
| 58 // TODO(jamiewalch): Add the plumbing required to get the client id and |
| 59 // shared secret from the web-app. |
| 60 std::string client_id, shared_secret; |
| 58 scoped_ptr<protocol::Authenticator> authenticator( | 61 scoped_ptr<protocol::Authenticator> authenticator( |
| 59 new protocol::NegotiatingClientAuthenticator( | 62 new protocol::NegotiatingClientAuthenticator( |
| 63 client_id, shared_secret, |
| 60 config_.authentication_tag, config_.fetch_secret_callback, | 64 config_.authentication_tag, config_.fetch_secret_callback, |
| 61 user_interface_->GetTokenFetcher(config_.host_public_key), | 65 user_interface_->GetTokenFetcher(config_.host_public_key), |
| 62 config_.authentication_methods)); | 66 config_.authentication_methods)); |
| 63 | 67 |
| 64 // Create a WeakPtr to ourself for to use for all posted tasks. | 68 // Create a WeakPtr to ourself for to use for all posted tasks. |
| 65 weak_ptr_ = weak_factory_.GetWeakPtr(); | 69 weak_ptr_ = weak_factory_.GetWeakPtr(); |
| 66 | 70 |
| 67 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 71 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, |
| 68 config_.host_public_key, transport_factory.Pass(), | 72 config_.host_public_key, transport_factory.Pass(), |
| 69 authenticator.Pass(), this, this, this, | 73 authenticator.Pass(), this, this, this, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 if (connection_->config().SupportsCapabilities()) { | 175 if (connection_->config().SupportsCapabilities()) { |
| 172 VLOG(1) << "Client capabilities: " << config_.capabilities; | 176 VLOG(1) << "Client capabilities: " << config_.capabilities; |
| 173 | 177 |
| 174 protocol::Capabilities capabilities; | 178 protocol::Capabilities capabilities; |
| 175 capabilities.set_capabilities(config_.capabilities); | 179 capabilities.set_capabilities(config_.capabilities); |
| 176 connection_->host_stub()->SetCapabilities(capabilities); | 180 connection_->host_stub()->SetCapabilities(capabilities); |
| 177 } | 181 } |
| 178 } | 182 } |
| 179 | 183 |
| 180 } // namespace remoting | 184 } // namespace remoting |
| OLD | NEW |