Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: chromeos/system/statistics_provider.h

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Address Maksim's comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/system/statistics_provider.h
diff --git a/chromeos/system/statistics_provider.h b/chromeos/system/statistics_provider.h
index 62305e8a3ce9e892e16c5491cc0fd1c7bf135b4a..f8c44fbf6b33a84d24ae81889010188767ef8eca 100644
--- a/chromeos/system/statistics_provider.h
+++ b/chromeos/system/statistics_provider.h
@@ -41,6 +41,10 @@ CHROMEOS_EXPORT extern const char kFirmwareTypeValueDeveloper[];
CHROMEOS_EXPORT extern const char kFirmwareTypeValueNonchrome[];
CHROMEOS_EXPORT extern const char kFirmwareTypeValueNormal[];
+// Serial number key (only VPD v2+ devices). Use GetEnterpriseMachineID() to
+// cover legacy devices.
+CHROMEOS_EXPORT extern const char kSerialNumberKey[];
+
// HWID key.
CHROMEOS_EXPORT extern const char kHardwareClassKey[];
@@ -103,12 +107,18 @@ class CHROMEOS_EXPORT StatisticsProvider {
virtual bool GetMachineStatistic(const std::string& name,
std::string* result) = 0;
- // Checks whether a machine statistic is present (without logging a warning).
- bool HasMachineStatistic(const std::string& name);
-
// Similar to GetMachineStatistic for boolean flags.
virtual bool GetMachineFlag(const std::string& name, bool* result) = 0;
+ // Returns the machine serial number after examining a set of well-known
+ // keys. In case no serial is found (possibly due to the device having already
+ // been enrolled or claimed by a local user), an empty string is returned.
+ // Caveat: For lumpy, the last letter is ommitted from the serial number for
+ // historical reasons.
+ // TODO(tnagel): Drop "Enterprise" from the method name and remove lumpy
+ // special casing after lumpy EOL.
+ std::string GetEnterpriseMachineID();
+
// Cancels any pending file operations.
virtual void Shutdown() = 0;
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc ('k') | chromeos/system/statistics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698