| 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/client/chromoting_view.h" | 8 #include "remoting/client/chromoting_view.h" |
| 9 #include "remoting/client/client_context.h" | 9 #include "remoting/client/client_context.h" |
| 10 #include "remoting/client/rectangle_update_decoder.h" | 10 #include "remoting/client/rectangle_update_decoder.h" |
| 11 #include "remoting/protocol/authentication_method.h" | 11 #include "remoting/protocol/authentication_method.h" |
| 12 #include "remoting/protocol/connection_to_host.h" | 12 #include "remoting/protocol/connection_to_host.h" |
| 13 #include "remoting/protocol/negotiating_authenticator.h" | 13 #include "remoting/protocol/negotiating_authenticator.h" |
| 14 #include "remoting/protocol/v1_authenticator.h" | |
| 15 #include "remoting/protocol/session_config.h" | 14 #include "remoting/protocol/session_config.h" |
| 16 #include "remoting/protocol/transport.h" | 15 #include "remoting/protocol/transport.h" |
| 17 | 16 |
| 18 namespace remoting { | 17 namespace remoting { |
| 19 | 18 |
| 20 using protocol::AuthenticationMethod; | 19 using protocol::AuthenticationMethod; |
| 21 | 20 |
| 22 ChromotingClient::QueuedVideoPacket::QueuedVideoPacket( | 21 ChromotingClient::QueuedVideoPacket::QueuedVideoPacket( |
| 23 scoped_ptr<VideoPacket> packet, const base::Closure& done) | 22 scoped_ptr<VideoPacket> packet, const base::Closure& done) |
| 24 : packet(packet.release()), done(done) { | 23 : packet(packet.release()), done(done) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 46 | 45 |
| 47 ChromotingClient::~ChromotingClient() { | 46 ChromotingClient::~ChromotingClient() { |
| 48 } | 47 } |
| 49 | 48 |
| 50 void ChromotingClient::Start( | 49 void ChromotingClient::Start( |
| 51 scoped_refptr<XmppProxy> xmpp_proxy, | 50 scoped_refptr<XmppProxy> xmpp_proxy, |
| 52 scoped_ptr<protocol::TransportFactory> transport_factory) { | 51 scoped_ptr<protocol::TransportFactory> transport_factory) { |
| 53 DCHECK(message_loop()->BelongsToCurrentThread()); | 52 DCHECK(message_loop()->BelongsToCurrentThread()); |
| 54 | 53 |
| 55 scoped_ptr<protocol::Authenticator> authenticator; | 54 scoped_ptr<protocol::Authenticator> authenticator; |
| 56 if (config_.use_v1_authenticator) { | 55 authenticator = protocol::NegotiatingAuthenticator::CreateForClient( |
| 57 authenticator.reset(new protocol::V1ClientAuthenticator( | 56 config_.authentication_tag, |
| 58 config_.local_jid, config_.shared_secret)); | 57 config_.shared_secret, config_.authentication_methods); |
| 59 } else { | |
| 60 authenticator = protocol::NegotiatingAuthenticator::CreateForClient( | |
| 61 config_.authentication_tag, | |
| 62 config_.shared_secret, config_.authentication_methods); | |
| 63 } | |
| 64 | 58 |
| 65 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 59 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, |
| 66 config_.host_public_key, transport_factory.Pass(), | 60 config_.host_public_key, transport_factory.Pass(), |
| 67 authenticator.Pass(), this, this, this, this); | 61 authenticator.Pass(), this, this, this, this); |
| 68 | 62 |
| 69 if (!view_->Initialize()) { | 63 if (!view_->Initialize()) { |
| 70 ClientDone(); | 64 ClientDone(); |
| 71 } | 65 } |
| 72 } | 66 } |
| 73 | 67 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 thread_proxy_.PostTask(FROM_HERE, base::Bind( | 213 thread_proxy_.PostTask(FROM_HERE, base::Bind( |
| 220 &ChromotingClient::Initialize, base::Unretained(this))); | 214 &ChromotingClient::Initialize, base::Unretained(this))); |
| 221 return; | 215 return; |
| 222 } | 216 } |
| 223 | 217 |
| 224 // Initialize the decoder. | 218 // Initialize the decoder. |
| 225 rectangle_decoder_->Initialize(connection_->config()); | 219 rectangle_decoder_->Initialize(connection_->config()); |
| 226 } | 220 } |
| 227 | 221 |
| 228 } // namespace remoting | 222 } // namespace remoting |
| OLD | NEW |