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

Unified Diff: chrome/browser/chromeos/login/version_info_updater.cc

Issue 613653004: Show the serial number of the device in the version string if available. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/chromeos/login/version_info_updater.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/version_info_updater.cc
diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc
index 0b0d7f8c6c2a76151ab3e5adcfe1d27f12a47082..edd28576eb96c3e223178d7555167d904c9de721 100644
--- a/chrome/browser/chromeos/login/version_info_updater.cc
+++ b/chrome/browser/chromeos/login/version_info_updater.cc
@@ -33,7 +33,10 @@ const char* kReportingFlags[] = {
chromeos::kReportDeviceLocation,
};
-}
+// Strings used to generate the serial number part of the version string.
+const char kSerialNumberPrefix[] = "SN:";
+
+} // namespace
///////////////////////////////////////////////////////////////////////////////
// VersionInfoUpdater public:
@@ -92,12 +95,15 @@ void VersionInfoUpdater::UpdateVersionLabel() {
if (version_text_.empty())
return;
+ UpdateSerialNumberInfo();
+
chrome::VersionInfo version_info;
std::string label_text = l10n_util::GetStringFUTF8(
IDS_LOGIN_VERSION_LABEL_FORMAT,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
base::UTF8ToUTF16(version_info.Version()),
- base::UTF8ToUTF16(version_text_));
+ base::UTF8ToUTF16(version_text_),
+ base::UTF8ToUTF16(serial_number_text_));
// Workaround over incorrect width calculation in old fonts.
// TODO(glotov): remove the following line when new fonts are used.
@@ -124,6 +130,14 @@ void VersionInfoUpdater::SetEnterpriseInfo(const std::string& domain_name) {
}
}
+void VersionInfoUpdater::UpdateSerialNumberInfo() {
+ std::string sn = policy::DeviceCloudPolicyManagerChromeOS::GetMachineID();
+ if (!sn.empty()) {
+ serial_number_text_ = kSerialNumberPrefix;
+ serial_number_text_.append(sn);
+ }
+}
+
void VersionInfoUpdater::OnVersion(const std::string& version) {
version_text_ = version;
UpdateVersionLabel();
« no previous file with comments | « chrome/browser/chromeos/login/version_info_updater.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698