| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/policy/device_management_service_configuration.h" | 5 #include "chrome/browser/policy/device_management_service_configuration.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include <stdint.h> |
| 8 |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 10 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
| 12 #include "build/build_config.h" |
| 11 #include "components/policy/core/browser/browser_policy_connector.h" | 13 #include "components/policy/core/browser/browser_policy_connector.h" |
| 12 #include "components/version_info/version_info.h" | 14 #include "components/version_info/version_info.h" |
| 13 | 15 |
| 14 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 15 #include "chromeos/system/statistics_provider.h" | 17 #include "chromeos/system/statistics_provider.h" |
| 16 #endif | 18 #endif |
| 17 | 19 |
| 18 namespace policy { | 20 namespace policy { |
| 19 | 21 |
| 20 DeviceManagementServiceConfiguration::DeviceManagementServiceConfiguration( | 22 DeviceManagementServiceConfiguration::DeviceManagementServiceConfiguration( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 if (!provider->GetMachineStatistic(chromeos::system::kHardwareClassKey, | 50 if (!provider->GetMachineStatistic(chromeos::system::kHardwareClassKey, |
| 49 &hwclass)) { | 51 &hwclass)) { |
| 50 LOG(ERROR) << "Failed to get machine information"; | 52 LOG(ERROR) << "Failed to get machine information"; |
| 51 } | 53 } |
| 52 os_name += ",CrOS," + base::SysInfo::GetLsbReleaseBoard(); | 54 os_name += ",CrOS," + base::SysInfo::GetLsbReleaseBoard(); |
| 53 os_hardware += "," + hwclass; | 55 os_hardware += "," + hwclass; |
| 54 #endif | 56 #endif |
| 55 | 57 |
| 56 std::string os_version("-"); | 58 std::string os_version("-"); |
| 57 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 59 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 58 int32 os_major_version = 0; | 60 int32_t os_major_version = 0; |
| 59 int32 os_minor_version = 0; | 61 int32_t os_minor_version = 0; |
| 60 int32 os_bugfix_version = 0; | 62 int32_t os_bugfix_version = 0; |
| 61 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, | 63 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
| 62 &os_minor_version, | 64 &os_minor_version, |
| 63 &os_bugfix_version); | 65 &os_bugfix_version); |
| 64 os_version = base::StringPrintf("%d.%d.%d", | 66 os_version = base::StringPrintf("%d.%d.%d", |
| 65 os_major_version, | 67 os_major_version, |
| 66 os_minor_version, | 68 os_minor_version, |
| 67 os_bugfix_version); | 69 os_bugfix_version); |
| 68 #endif | 70 #endif |
| 69 | 71 |
| 70 return base::StringPrintf( | 72 return base::StringPrintf( |
| 71 "%s|%s|%s", os_name.c_str(), os_hardware.c_str(), os_version.c_str()); | 73 "%s|%s|%s", os_name.c_str(), os_hardware.c_str(), os_version.c_str()); |
| 72 } | 74 } |
| 73 | 75 |
| 74 } // namespace policy | 76 } // namespace policy |
| OLD | NEW |