OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 pp::VarPrivate object = GetInstanceObject(); | 271 pp::VarPrivate object = GetInstanceObject(); |
272 if (!object.is_undefined()) { | 272 if (!object.is_undefined()) { |
273 pp::deprecated::ScriptableObject* so = object.AsScriptableObject(); | 273 pp::deprecated::ScriptableObject* so = object.AsScriptableObject(); |
274 DCHECK(so != NULL); | 274 DCHECK(so != NULL); |
275 return static_cast<ChromotingScriptableObject*>(so); | 275 return static_cast<ChromotingScriptableObject*>(so); |
276 } | 276 } |
277 LOG(ERROR) << "Unable to get ScriptableObject for Chromoting plugin."; | 277 LOG(ERROR) << "Unable to get ScriptableObject for Chromoting plugin."; |
278 return NULL; | 278 return NULL; |
279 } | 279 } |
280 | 280 |
281 void ChromotingInstance::SubmitLoginInfo(const std::string& username, | |
282 const std::string& password) { | |
283 if (host_connection_->state() != protocol::ConnectionToHost::CONNECTED) { | |
284 LOG(INFO) << "Client not connected or already authenticated."; | |
285 return; | |
286 } | |
287 | |
288 protocol::LocalLoginCredentials* credentials = | |
289 new protocol::LocalLoginCredentials(); | |
290 credentials->set_type(protocol::PASSWORD); | |
291 credentials->set_username(username); | |
292 credentials->set_credential(password.data(), password.length()); | |
293 | |
294 host_connection_->host_stub()->BeginSessionRequest( | |
295 credentials, | |
296 base::Bind(&DeletePointer<protocol::LocalLoginCredentials>, credentials)); | |
297 } | |
298 | |
299 void ChromotingInstance::SetScaleToFit(bool scale_to_fit) { | 281 void ChromotingInstance::SetScaleToFit(bool scale_to_fit) { |
300 DCHECK(plugin_message_loop_->BelongsToCurrentThread()); | 282 DCHECK(plugin_message_loop_->BelongsToCurrentThread()); |
301 | 283 |
302 if (scale_to_fit == scale_to_fit_) | 284 if (scale_to_fit == scale_to_fit_) |
303 return; | 285 return; |
304 | 286 |
305 scale_to_fit_ = scale_to_fit; | 287 scale_to_fit_ = scale_to_fit; |
306 if (scale_to_fit) { | 288 if (scale_to_fit) { |
307 rectangle_decoder_->SetScaleRatios(view_->GetHorizontalScaleRatio(), | 289 rectangle_decoder_->SetScaleRatios(view_->GetHorizontalScaleRatio(), |
308 view_->GetVerticalScaleRatio()); | 290 view_->GetVerticalScaleRatio()); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 402 |
421 void ChromotingInstance::ReleaseAllKeys() { | 403 void ChromotingInstance::ReleaseAllKeys() { |
422 if (!input_handler_.get()) { | 404 if (!input_handler_.get()) { |
423 return; | 405 return; |
424 } | 406 } |
425 | 407 |
426 input_handler_->ReleaseAllKeys(); | 408 input_handler_->ReleaseAllKeys(); |
427 } | 409 } |
428 | 410 |
429 } // namespace remoting | 411 } // namespace remoting |
OLD | NEW |