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