| 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/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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 PostChromotingMessage("onConnectionReady", data.Pass()); | 499 PostChromotingMessage("onConnectionReady", data.Pass()); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { | 502 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { |
| 503 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 503 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 504 data->SetString("capabilities", capabilities); | 504 data->SetString("capabilities", capabilities); |
| 505 PostChromotingMessage("setCapabilities", data.Pass()); | 505 PostChromotingMessage("setCapabilities", data.Pass()); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void ChromotingInstance::FetchSecretFromDialog( | 508 void ChromotingInstance::FetchSecretFromDialog( |
| 509 const protocol::SecretFetchedCallback& secret_fetched_callback) { | 509 const protocol::SecretFetchedCallback& secret_fetched_callback, |
| 510 bool pairing_supported) { |
| 510 // Once the Session object calls this function, it won't continue the | 511 // Once the Session object calls this function, it won't continue the |
| 511 // authentication until the callback is called (or connection is canceled). | 512 // authentication until the callback is called (or connection is canceled). |
| 512 // So, it's impossible to reach this with a callback already registered. | 513 // So, it's impossible to reach this with a callback already registered. |
| 513 DCHECK(secret_fetched_callback_.is_null()); | 514 DCHECK(secret_fetched_callback_.is_null()); |
| 514 secret_fetched_callback_ = secret_fetched_callback; | 515 secret_fetched_callback_ = secret_fetched_callback; |
| 515 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 516 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 517 data->SetBoolean("pairingSupported", pairing_supported); |
| 516 PostChromotingMessage("fetchPin", data.Pass()); | 518 PostChromotingMessage("fetchPin", data.Pass()); |
| 517 } | 519 } |
| 518 | 520 |
| 519 void ChromotingInstance::FetchSecretFromString( | 521 void ChromotingInstance::FetchSecretFromString( |
| 520 const std::string& shared_secret, | 522 const std::string& shared_secret, |
| 521 const protocol::SecretFetchedCallback& secret_fetched_callback) { | 523 const protocol::SecretFetchedCallback& secret_fetched_callback, |
| 524 bool pairing_supported) { |
| 522 secret_fetched_callback.Run(shared_secret); | 525 secret_fetched_callback.Run(shared_secret); |
| 523 } | 526 } |
| 524 | 527 |
| 525 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { | 528 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { |
| 526 // TODO(sergeyu): Move clipboard handling to a separate class. | 529 // TODO(sergeyu): Move clipboard handling to a separate class. |
| 527 // crbug.com/138108 | 530 // crbug.com/138108 |
| 528 return this; | 531 return this; |
| 529 } | 532 } |
| 530 | 533 |
| 531 protocol::CursorShapeStub* ChromotingInstance::GetCursorShapeStub() { | 534 protocol::CursorShapeStub* ChromotingInstance::GetCursorShapeStub() { |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 url_components.scheme.len); | 948 url_components.scheme.len); |
| 946 return url_scheme == kChromeExtensionUrlScheme; | 949 return url_scheme == kChromeExtensionUrlScheme; |
| 947 } | 950 } |
| 948 | 951 |
| 949 bool ChromotingInstance::IsConnected() { | 952 bool ChromotingInstance::IsConnected() { |
| 950 return host_connection_.get() && | 953 return host_connection_.get() && |
| 951 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 954 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
| 952 } | 955 } |
| 953 | 956 |
| 954 } // namespace remoting | 957 } // namespace remoting |
| OLD | NEW |