| 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/host/host_details.h" | 5 #include "remoting/host/host_details.h" |
| 6 | 6 |
| 7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_LINUX) | 10 #if defined(OS_LINUX) |
| 11 #include "base/linux_util.h" | 11 #include "base/linux_util.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 // Get the host Operating System Name, removing the need to check for OS | 16 // Get the host Operating System Name, removing the need to check for OS |
| 17 // definitions and keeps the keys used consistant. | 17 // definitions and keeps the keys used consistant. |
| 18 std::string GetHostOperatingSystemName() { | 18 std::string GetHostOperatingSystemName() { |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 return "Windows"; | 20 return "Windows"; |
| 21 #elif defined(OS_MACOSX) | 21 #elif defined(OS_MACOSX) |
| 22 return "Mac"; | 22 return "Mac"; |
| 23 #elif defined(OS_CHROMEOS) | 23 #elif defined(OS_CHROMEOS) |
| 24 return "ChromeOS"; | 24 return "ChromeOS"; |
| 25 #elif defined(OS_LINUX) | 25 #elif defined(OS_LINUX) |
| 26 return "Linux"; | 26 return "Linux"; |
| 27 #elif defined(OS_ANDROID) |
| 28 return "Android"; |
| 29 #else |
| 30 #error "Unsupported host OS" |
| 27 #endif | 31 #endif |
| 28 } | 32 } |
| 29 | 33 |
| 30 // Get the host Operating System Version, removing the need to check for OS | 34 // Get the host Operating System Version, removing the need to check for OS |
| 31 // definitions and keeps the format used consistant. | 35 // definitions and keeps the format used consistant. |
| 32 std::string GetHostOperatingSystemVersion() { | 36 std::string GetHostOperatingSystemVersion() { |
| 33 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 37 #if defined(OS_LINUX) |
| 38 return base::GetLinuxDistro(); |
| 39 #else |
| 34 return base::SysInfo::OperatingSystemVersion(); | 40 return base::SysInfo::OperatingSystemVersion(); |
| 35 #elif defined(OS_LINUX) | |
| 36 return base::GetLinuxDistro(); | |
| 37 #endif | 41 #endif |
| 38 } | 42 } |
| 39 | 43 |
| 40 } // namespace remoting | 44 } // namespace remoting |
| OLD | NEW |