| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/test/remote_host_info.h" | 5 #include "remoting/test/remote_host_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace remoting { |
| 10 namespace test { | 10 namespace test { |
| 11 | 11 |
| 12 RemoteHostInfo::RemoteHostInfo() : | 12 RemoteHostInfo::RemoteHostInfo() |
| 13 remote_host_status(kRemoteHostStatusUnknown) {} | 13 : remote_host_status(kRemoteHostStatusUnknown) { |
| 14 } |
| 14 | 15 |
| 15 RemoteHostInfo::~RemoteHostInfo() {} | 16 RemoteHostInfo::~RemoteHostInfo() { |
| 17 } |
| 16 | 18 |
| 17 bool RemoteHostInfo::IsReadyForConnection() const { | 19 bool RemoteHostInfo::IsReadyForConnection() const { |
| 18 return (remote_host_status == kRemoteHostStatusReady); | 20 return (remote_host_status == kRemoteHostStatusReady); |
| 19 } | 21 } |
| 20 | 22 |
| 21 void RemoteHostInfo::SetRemoteHostStatusFromString( | 23 void RemoteHostInfo::SetRemoteHostStatusFromString( |
| 22 const std::string& status_string) { | 24 const std::string& status_string) { |
| 23 if (status_string == "done") { | 25 if (status_string == "done") { |
| 24 remote_host_status = kRemoteHostStatusReady; | 26 remote_host_status = kRemoteHostStatusReady; |
| 25 } else if (status_string == "pending") { | 27 } else if (status_string == "pending") { |
| 26 remote_host_status = kRemoteHostStatusPending; | 28 remote_host_status = kRemoteHostStatusPending; |
| 27 } else { | 29 } else { |
| 28 LOG(WARNING) << "Unknown status passed in: " << status_string; | 30 LOG(WARNING) << "Unknown status passed in: " << status_string; |
| 29 remote_host_status = kRemoteHostStatusUnknown; | 31 remote_host_status = kRemoteHostStatusUnknown; |
| 30 } | 32 } |
| 31 } | 33 } |
| 32 | 34 |
| 33 } // namespace test | 35 } // namespace test |
| 34 } // namespace remoting | 36 } // namespace remoting |
| OLD | NEW |