Chromium Code Reviews| 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 // Key/values reporting if Chrome OS is running in a VM or not. These values are | |
| 48 // read from crossystem output. See crossystem source for VM detection logic. | |
| 49 CHROMEOS_EXPORT extern const char kIsCrosVmKey[]; | |
| 50 CHROMEOS_EXPORT extern const char kIsCrosVmValueTrue[]; | |
| 51 CHROMEOS_EXPORT extern const char kIsCrosVmValueFalse[]; | |
| 52 | |
| 47 // System vendor key. | 53 // System vendor key. |
| 48 // The value is used to check if Chrome is running on a VM or a real Chrome OS | 54 // Empty on non-x86 architectures, most meaningful in VM environments |
|
Daniel Erat
2016/08/10 16:32:28
nit: add trailing period
| |
| 49 // device. On QEMU VMs this value is QEMU. | |
| 50 CHROMEOS_EXPORT extern const char kSystemVendorKey[]; | 55 CHROMEOS_EXPORT extern const char kSystemVendorKey[]; |
|
achuithb
2016/08/10 18:24:58
We should just get rid of kSystemVendorKey. I beli
norvez
2016/08/11 17:10:34
Done.
| |
| 51 | 56 |
| 52 // OEM customization flag that permits exiting enterprise enrollment flow in | 57 // OEM customization flag that permits exiting enterprise enrollment flow in |
| 53 // OOBE when 'oem_enterprise_managed' flag is set. | 58 // OOBE when 'oem_enterprise_managed' flag is set. |
| 54 CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[]; | 59 CHROMEOS_EXPORT extern const char kOemCanExitEnterpriseEnrollmentKey[]; |
| 55 | 60 |
| 56 // OEM customization directive that specified intended device purpose. | 61 // OEM customization directive that specified intended device purpose. |
| 57 CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[]; | 62 CHROMEOS_EXPORT extern const char kOemDeviceRequisitionKey[]; |
| 58 | 63 |
| 59 // OEM customization flag that enforces enterprise enrollment flow in OOBE. | 64 // OEM customization flag that enforces enterprise enrollment flow in OOBE. |
| 60 CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[]; | 65 CHROMEOS_EXPORT extern const char kOemIsEnterpriseManagedKey[]; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 109 |
| 105 // Checks whether a machine statistic is present (without logging a warning). | 110 // Checks whether a machine statistic is present (without logging a warning). |
| 106 bool HasMachineStatistic(const std::string& name); | 111 bool HasMachineStatistic(const std::string& name); |
| 107 | 112 |
| 108 // Similar to GetMachineStatistic for boolean flags. | 113 // Similar to GetMachineStatistic for boolean flags. |
| 109 virtual bool GetMachineFlag(const std::string& name, bool* result) = 0; | 114 virtual bool GetMachineFlag(const std::string& name, bool* result) = 0; |
| 110 | 115 |
| 111 // Cancels any pending file operations. | 116 // Cancels any pending file operations. |
| 112 virtual void Shutdown() = 0; | 117 virtual void Shutdown() = 0; |
| 113 | 118 |
| 119 // Returns true if the machine is a VM | |
|
Daniel Erat
2016/08/10 16:32:28
nit: add trailing period
norvez
2016/08/11 17:10:34
Done.
| |
| 120 virtual bool IsRunningOnVm() = 0; | |
| 121 | |
| 114 // Get the Singleton instance. | 122 // Get the Singleton instance. |
| 115 static StatisticsProvider* GetInstance(); | 123 static StatisticsProvider* GetInstance(); |
| 116 | 124 |
| 117 // Set the instance returned by GetInstance() for testing. | 125 // Set the instance returned by GetInstance() for testing. |
| 118 static void SetTestProvider(StatisticsProvider* test_provider); | 126 static void SetTestProvider(StatisticsProvider* test_provider); |
| 119 | 127 |
| 120 protected: | 128 protected: |
| 121 virtual ~StatisticsProvider() {} | 129 virtual ~StatisticsProvider() {} |
| 122 }; | 130 }; |
| 123 | 131 |
| 124 } // namespace system | 132 } // namespace system |
| 125 } // namespace chromeos | 133 } // namespace chromeos |
| 126 | 134 |
| 127 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 135 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
| OLD | NEW |