| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 5 #ifndef CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
| 6 #define CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 6 #define CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // machine doesn't run on Chrome OS firmware. See crossystem source for more | 37 // machine doesn't run on Chrome OS firmware. See crossystem source for more |
| 38 // details. | 38 // details. |
| 39 CHROMEOS_EXPORT extern const char kFirmwareTypeKey[]; | 39 CHROMEOS_EXPORT extern const char kFirmwareTypeKey[]; |
| 40 CHROMEOS_EXPORT extern const char kFirmwareTypeValueDeveloper[]; | 40 CHROMEOS_EXPORT extern const char kFirmwareTypeValueDeveloper[]; |
| 41 CHROMEOS_EXPORT extern const char kFirmwareTypeValueNonchrome[]; | 41 CHROMEOS_EXPORT extern const char kFirmwareTypeValueNonchrome[]; |
| 42 CHROMEOS_EXPORT extern const char kFirmwareTypeValueNormal[]; | 42 CHROMEOS_EXPORT extern const char kFirmwareTypeValueNormal[]; |
| 43 | 43 |
| 44 // HWID key. | 44 // HWID key. |
| 45 CHROMEOS_EXPORT extern const char kHardwareClassKey[]; | 45 CHROMEOS_EXPORT extern const char kHardwareClassKey[]; |
| 46 | 46 |
| 47 // System vendor key. | 47 // Key/values reporting if Chrome OS is running in a VM or not. These values are |
| 48 // The value is used to check if Chrome is running on a VM or a real Chrome OS | 48 // read from crossystem output. See crossystem source for VM detection logic. |
| 49 // device. On QEMU VMs this value is QEMU. | 49 CHROMEOS_EXPORT extern const char kIsVmKey[]; |
| 50 CHROMEOS_EXPORT extern const char kSystemVendorKey[]; | 50 CHROMEOS_EXPORT extern const char kIsVmValueTrue[]; |
| 51 CHROMEOS_EXPORT extern const char kIsVmValueFalse[]; |
| 51 | 52 |
| 52 // OEM customization flag that permits exiting enterprise enrollment flow in | 53 // OEM customization flag that permits exiting enterprise enrollment flow in |
| 53 // OOBE when 'oem_enterprise_managed' flag is set. | 54 // OOBE when 'oem_enterprise_managed' flag is set. |
| 54 CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[]; | 55 CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[]; |
| 55 | 56 |
| 56 // OEM customization directive that specified intended device purpose. | 57 // OEM customization directive that specified intended device purpose. |
| 57 CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[]; | 58 CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[]; |
| 58 | 59 |
| 59 // OEM customization flag that enforces enterprise enrollment flow in OOBE. | 60 // OEM customization flag that enforces enterprise enrollment flow in OOBE. |
| 60 CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[]; | 61 CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[]; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 105 |
| 105 // Checks whether a machine statistic is present (without logging a warning). | 106 // Checks whether a machine statistic is present (without logging a warning). |
| 106 bool HasMachineStatistic(const std::string& name); | 107 bool HasMachineStatistic(const std::string& name); |
| 107 | 108 |
| 108 // Similar to GetMachineStatistic for boolean flags. | 109 // Similar to GetMachineStatistic for boolean flags. |
| 109 virtual bool GetMachineFlag(const std::string& name, bool* result) = 0; | 110 virtual bool GetMachineFlag(const std::string& name, bool* result) = 0; |
| 110 | 111 |
| 111 // Cancels any pending file operations. | 112 // Cancels any pending file operations. |
| 112 virtual void Shutdown() = 0; | 113 virtual void Shutdown() = 0; |
| 113 | 114 |
| 115 // Returns true if the machine is a VM. |
| 116 virtual bool IsRunningOnVm() = 0; |
| 117 |
| 114 // Get the Singleton instance. | 118 // Get the Singleton instance. |
| 115 static StatisticsProvider* GetInstance(); | 119 static StatisticsProvider* GetInstance(); |
| 116 | 120 |
| 117 // Set the instance returned by GetInstance() for testing. | 121 // Set the instance returned by GetInstance() for testing. |
| 118 static void SetTestProvider(StatisticsProvider* test_provider); | 122 static void SetTestProvider(StatisticsProvider* test_provider); |
| 119 | 123 |
| 120 protected: | 124 protected: |
| 121 virtual ~StatisticsProvider() {} | 125 virtual ~StatisticsProvider() {} |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // namespace system | 128 } // namespace system |
| 125 } // namespace chromeos | 129 } // namespace chromeos |
| 126 | 130 |
| 127 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 131 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
| OLD | NEW |