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" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 | 12 |
13 namespace base { | |
14 class TaskRunner; | |
15 } | |
16 | |
17 namespace chromeos { | 13 namespace chromeos { |
18 namespace system { | 14 namespace system { |
19 | 15 |
20 // Activation date key. | 16 // Activation date key. |
21 CHROMEOS_EXPORT extern const char kActivateDateKey[]; | 17 CHROMEOS_EXPORT extern const char kActivateDateKey[]; |
22 | 18 |
23 // The key that will be present in VPD if the device ever was enrolled. | 19 // The key that will be present in VPD if the device ever was enrolled. |
24 CHROMEOS_EXPORT extern const char kCheckEnrollmentKey[]; | 20 CHROMEOS_EXPORT extern const char kCheckEnrollmentKey[]; |
25 | 21 |
26 // Customization ID key. | 22 // Customization ID key. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 80 |
85 // Regional data | 81 // Regional data |
86 CHROMEOS_EXPORT extern const char kRegionKey[]; | 82 CHROMEOS_EXPORT extern const char kRegionKey[]; |
87 CHROMEOS_EXPORT extern const char kInitialLocaleKey[]; | 83 CHROMEOS_EXPORT extern const char kInitialLocaleKey[]; |
88 CHROMEOS_EXPORT extern const char kInitialTimezoneKey[]; | 84 CHROMEOS_EXPORT extern const char kInitialTimezoneKey[]; |
89 CHROMEOS_EXPORT extern const char kKeyboardLayoutKey[]; | 85 CHROMEOS_EXPORT extern const char kKeyboardLayoutKey[]; |
90 | 86 |
91 // This interface provides access to Chrome OS statistics. | 87 // This interface provides access to Chrome OS statistics. |
92 class CHROMEOS_EXPORT StatisticsProvider { | 88 class CHROMEOS_EXPORT StatisticsProvider { |
93 public: | 89 public: |
94 // Starts loading the machine statistics. File operations are performed on | 90 // Starts loading the machine statistics. |
95 // |file_task_runner|. | 91 virtual void StartLoadingMachineStatistics(bool load_oem_manifest) = 0; |
96 virtual void StartLoadingMachineStatistics( | |
97 const scoped_refptr<base::TaskRunner>& file_task_runner, | |
98 bool load_oem_manifest) = 0; | |
99 | 92 |
100 // Returns true if the named machine statistic (e.g. "hardware_class") is | 93 // Returns true if the named machine statistic (e.g. "hardware_class") is |
101 // found and stores it in |result| (if provided). Probing for the existence of | 94 // found and stores it in |result| (if provided). Probing for the existence of |
102 // a statistic by setting |result| to nullptr supresses the usual warning in | 95 // a statistic by setting |result| to nullptr supresses the usual warning in |
103 // case the statistic is not found. Safe to call from any thread except the | 96 // case the statistic is not found. Safe to call from any thread except the |
104 // task runner passed to Initialize() (e.g. FILE). This may block if called | 97 // task runner passed to Initialize() (e.g. FILE). This may block if called |
105 // early before the statistics are loaded from disk. | 98 // early before the statistics are loaded from disk. |
106 // StartLoadingMachineStatistics() must be called before this. | 99 // StartLoadingMachineStatistics() must be called before this. |
107 virtual bool GetMachineStatistic(const std::string& name, | 100 virtual bool GetMachineStatistic(const std::string& name, |
108 std::string* result) = 0; | 101 std::string* result) = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
132 static void SetTestProvider(StatisticsProvider* test_provider); | 125 static void SetTestProvider(StatisticsProvider* test_provider); |
133 | 126 |
134 protected: | 127 protected: |
135 virtual ~StatisticsProvider() {} | 128 virtual ~StatisticsProvider() {} |
136 }; | 129 }; |
137 | 130 |
138 } // namespace system | 131 } // namespace system |
139 } // namespace chromeos | 132 } // namespace chromeos |
140 | 133 |
141 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 134 #endif // CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
OLD | NEW |