Chromium Code Reviews| 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" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 authenticator.reset(new protocol::V1ClientAuthenticator( | 57 authenticator.reset(new protocol::V1ClientAuthenticator( |
| 58 config_.local_jid, config_.shared_secret)); | 58 config_.local_jid, config_.shared_secret)); |
| 59 } else { | 59 } else { |
| 60 authenticator = protocol::NegotiatingAuthenticator::CreateForClient( | 60 authenticator = protocol::NegotiatingAuthenticator::CreateForClient( |
| 61 config_.authentication_tag, | 61 config_.authentication_tag, |
| 62 config_.shared_secret, config_.authentication_methods); | 62 config_.shared_secret, config_.authentication_methods); |
| 63 } | 63 } |
| 64 | 64 |
| 65 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, | 65 connection_->Connect(xmpp_proxy, config_.local_jid, config_.host_jid, |
| 66 config_.host_public_key, transport_factory.Pass(), | 66 config_.host_public_key, transport_factory.Pass(), |
| 67 authenticator.Pass(), this, this, this, this); | 67 authenticator.Pass(), this, this, this, this, this); |
| 68 | 68 |
| 69 if (!view_->Initialize()) { | 69 if (!view_->Initialize()) { |
| 70 ClientDone(); | 70 ClientDone(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ChromotingClient::Stop(const base::Closure& shutdown_task) { | 74 void ChromotingClient::Stop(const base::Closure& shutdown_task) { |
| 75 if (!message_loop()->BelongsToCurrentThread()) { | 75 if (!message_loop()->BelongsToCurrentThread()) { |
| 76 message_loop()->PostTask( | 76 message_loop()->PostTask( |
| 77 FROM_HERE, base::Bind(&ChromotingClient::Stop, | 77 FROM_HERE, base::Bind(&ChromotingClient::Stop, |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 105 | 105 |
| 106 ChromotingStats* ChromotingClient::GetStats() { | 106 ChromotingStats* ChromotingClient::GetStats() { |
| 107 return &stats_; | 107 return &stats_; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ChromotingClient::InjectClipboardEvent( | 110 void ChromotingClient::InjectClipboardEvent( |
| 111 const protocol::ClipboardEvent& event) { | 111 const protocol::ClipboardEvent& event) { |
| 112 view_->GetClipboardStub()->InjectClipboardEvent(event); | 112 view_->GetClipboardStub()->InjectClipboardEvent(event); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void ChromotingClient::SetCursorShape( | |
| 116 const protocol::CursorShapeInfo& cursor_shape) { | |
|
Wez
2012/05/23 00:01:57
Do we actually need ChromotingClient to implement
garykac
2012/05/26 01:58:01
ChromotingClient is currently where we handle all
| |
| 117 if (cursor_shape.has_data()) { | |
|
Wez
2012/05/23 00:01:57
The SetCursorShape() API doesn't specify any requi
garykac
2012/05/26 01:58:01
Done.
| |
| 118 view_->SetCursorShape(cursor_shape); | |
| 119 } | |
| 120 } | |
| 121 | |
| 115 void ChromotingClient::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 122 void ChromotingClient::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
| 116 const base::Closure& done) { | 123 const base::Closure& done) { |
| 117 DCHECK(message_loop()->BelongsToCurrentThread()); | 124 DCHECK(message_loop()->BelongsToCurrentThread()); |
| 118 | 125 |
| 119 // If the video packet is empty then drop it. Empty packets are used to | 126 // If the video packet is empty then drop it. Empty packets are used to |
| 120 // maintain activity on the network. | 127 // maintain activity on the network. |
| 121 if (!packet->has_data() || packet->data().size() == 0) { | 128 if (!packet->has_data() || packet->data().size() == 0) { |
| 122 done.Run(); | 129 done.Run(); |
| 123 return; | 130 return; |
| 124 } | 131 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 thread_proxy_.PostTask(FROM_HERE, base::Bind( | 226 thread_proxy_.PostTask(FROM_HERE, base::Bind( |
| 220 &ChromotingClient::Initialize, base::Unretained(this))); | 227 &ChromotingClient::Initialize, base::Unretained(this))); |
| 221 return; | 228 return; |
| 222 } | 229 } |
| 223 | 230 |
| 224 // Initialize the decoder. | 231 // Initialize the decoder. |
| 225 rectangle_decoder_->Initialize(connection_->config()); | 232 rectangle_decoder_->Initialize(connection_->config()); |
| 226 } | 233 } |
| 227 | 234 |
| 228 } // namespace remoting | 235 } // namespace remoting |
| OLD | NEW |