| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 data->SetString("scope", scope); | 429 data->SetString("scope", scope); |
| 430 PostChromotingMessage("fetchThirdPartyToken", data.Pass()); | 430 PostChromotingMessage("fetchThirdPartyToken", data.Pass()); |
| 431 } | 431 } |
| 432 | 432 |
| 433 void ChromotingInstance::OnConnectionReady(bool ready) { | 433 void ChromotingInstance::OnConnectionReady(bool ready) { |
| 434 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 434 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 435 data->SetBoolean("ready", ready); | 435 data->SetBoolean("ready", ready); |
| 436 PostChromotingMessage("onConnectionReady", data.Pass()); | 436 PostChromotingMessage("onConnectionReady", data.Pass()); |
| 437 } | 437 } |
| 438 | 438 |
| 439 void ChromotingInstance::OnRouteChanged(const std::string& channel_name, |
| 440 const protocol::TransportRoute& route) { |
| 441 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 442 data->SetString("channel", channel_name); |
| 443 data->SetString("type", protocol::TransportRoute::GetTypeString(route.type)); |
| 444 PostChromotingMessage("onRouteChanged", data.Pass()); |
| 445 } |
| 446 |
| 439 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { | 447 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { |
| 440 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 448 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 441 data->SetString("capabilities", capabilities); | 449 data->SetString("capabilities", capabilities); |
| 442 PostChromotingMessage("setCapabilities", data.Pass()); | 450 PostChromotingMessage("setCapabilities", data.Pass()); |
| 443 } | 451 } |
| 444 | 452 |
| 445 void ChromotingInstance::SetPairingResponse( | 453 void ChromotingInstance::SetPairingResponse( |
| 446 const protocol::PairingResponse& pairing_response) { | 454 const protocol::PairingResponse& pairing_response) { |
| 447 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 455 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
| 448 data->SetString("clientId", pairing_response.client_id()); | 456 data->SetString("clientId", pairing_response.client_id()); |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 url_components.scheme.len); | 1074 url_components.scheme.len); |
| 1067 return url_scheme == kChromeExtensionUrlScheme; | 1075 return url_scheme == kChromeExtensionUrlScheme; |
| 1068 } | 1076 } |
| 1069 | 1077 |
| 1070 bool ChromotingInstance::IsConnected() { | 1078 bool ChromotingInstance::IsConnected() { |
| 1071 return host_connection_.get() && | 1079 return host_connection_.get() && |
| 1072 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); | 1080 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); |
| 1073 } | 1081 } |
| 1074 | 1082 |
| 1075 } // namespace remoting | 1083 } // namespace remoting |
| OLD | NEW |