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 <nacl_io/nacl_io.h> | 10 #include <nacl_io/nacl_io.h> |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if (data.HasKey("capabilities")) { | 545 if (data.HasKey("capabilities")) { |
546 if (!data.GetString("capabilities", &capabilities)) { | 546 if (!data.GetString("capabilities", &capabilities)) { |
547 LOG(ERROR) << "Invalid connect() data."; | 547 LOG(ERROR) << "Invalid connect() data."; |
548 return; | 548 return; |
549 } | 549 } |
550 } | 550 } |
551 | 551 |
552 // Read and parse list of experiments. | 552 // Read and parse list of experiments. |
553 std::string experiments; | 553 std::string experiments; |
554 std::vector<std::string> experiments_list; | 554 std::vector<std::string> experiments_list; |
555 if (data.GetString("experiments", &experiments)) | 555 if (data.GetString("experiments", &experiments)) { |
556 base::SplitString(experiments, ' ', &experiments_list); | 556 experiments_list = base::SplitString( |
| 557 experiments, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 558 } |
557 | 559 |
558 VLOG(0) << "Connecting to " << host_jid | 560 VLOG(0) << "Connecting to " << host_jid |
559 << ". Local jid: " << local_jid << "."; | 561 << ". Local jid: " << local_jid << "."; |
560 | 562 |
561 std::string key_filter; | 563 std::string key_filter; |
562 if (!data.GetString("keyFilter", &key_filter)) { | 564 if (!data.GetString("keyFilter", &key_filter)) { |
563 NOTREACHED(); | 565 NOTREACHED(); |
564 normalizing_input_filter_.reset(new protocol::InputFilter(&key_mapper_)); | 566 normalizing_input_filter_.reset(new protocol::InputFilter(&key_mapper_)); |
565 } else if (key_filter == "mac") { | 567 } else if (key_filter == "mac") { |
566 normalizing_input_filter_.reset( | 568 normalizing_input_filter_.reset( |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 | 1063 |
1062 return false; | 1064 return false; |
1063 } | 1065 } |
1064 | 1066 |
1065 bool ChromotingInstance::IsConnected() { | 1067 bool ChromotingInstance::IsConnected() { |
1066 return client_ && | 1068 return client_ && |
1067 (client_->connection_state() == protocol::ConnectionToHost::CONNECTED); | 1069 (client_->connection_state() == protocol::ConnectionToHost::CONNECTED); |
1068 } | 1070 } |
1069 | 1071 |
1070 } // namespace remoting | 1072 } // namespace remoting |
OLD | NEW |