diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 11:25:09 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 11:25:09 +0000 |
commit | ce7dafef35bb799b113ec103eafc4dcbfc13aeb1 (patch) | |
tree | de40122d56b14edff51c97c0937100527a9916f1 | |
parent | 80e87994eaf31e2360e769448531d8da51b80797 (diff) | |
download | chromium_src-ce7dafef35bb799b113ec103eafc4dcbfc13aeb1.zip chromium_src-ce7dafef35bb799b113ec103eafc4dcbfc13aeb1.tar.gz chromium_src-ce7dafef35bb799b113ec103eafc4dcbfc13aeb1.tar.bz2 |
Remove hwid from machine statistics because it's duplicate of hardware_class
BUG=chromium-os:15579
TEST=none
Review URL: http://codereview.chromium.org/7008010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86599 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc index 9688370..73db372 100644 --- a/chrome/browser/chromeos/customization_document.cc +++ b/chrome/browser/chromeos/customization_document.cc @@ -42,7 +42,7 @@ const char kSupportPageAttr[] = "support_page"; const char kAcceptedManifestVersion[] = "1.0"; -const char kHwid[] = "hwid"; +const char kHardwareClass[] = "hardware_class"; // Carrier deals attributes. const char kCarrierDealsAttr[] = "carrier_deals"; @@ -172,7 +172,7 @@ void StartupCustomizationDocument::Init(SystemAccess* system_access) { root_->GetString(kRegistrationUrlAttr, ®istration_url_); std::string hwid; - if (system_access->GetMachineStatistic(kHwid, &hwid)) { + if (system_access->GetMachineStatistic(kHardwareClass, &hwid)) { ListValue* hwid_list = NULL; if (root_->GetList(kHwidMapAttr, &hwid_list)) { for (size_t i = 0; i < hwid_list->GetSize(); ++i) { diff --git a/chrome/browser/chromeos/customization_document_unittest.cc b/chrome/browser/chromeos/customization_document_unittest.cc index bafca5d..04d8d55 100644 --- a/chrome/browser/chromeos/customization_document_unittest.cc +++ b/chrome/browser/chromeos/customization_document_unittest.cc @@ -120,7 +120,7 @@ TEST(StartupCustomizationDocumentTest, Basic) { EXPECT_CALL(mock_system_access, GetMachineStatistic(_, NotNull())) .WillRepeatedly(Return(false)); EXPECT_CALL(mock_system_access, - GetMachineStatistic(std::string("hwid"), NotNull())) + GetMachineStatistic(std::string("hardware_class"), NotNull())) .WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")), Return(true))); StartupCustomizationDocument customization(&mock_system_access, @@ -148,7 +148,7 @@ TEST(StartupCustomizationDocumentTest, Basic) { TEST(StartupCustomizationDocumentTest, VPD) { MockSystemAccess mock_system_access; EXPECT_CALL(mock_system_access, - GetMachineStatistic(std::string("hwid"), NotNull())) + GetMachineStatistic(std::string("hardware_class"), NotNull())) .WillOnce(DoAll(SetArgumentPointee<1>(std::string("Mario 12345")), Return(true))); EXPECT_CALL(mock_system_access, diff --git a/chrome/browser/chromeos/system_access.cc b/chrome/browser/chromeos/system_access.cc index f197f99..f02a396 100644 --- a/chrome/browser/chromeos/system_access.cc +++ b/chrome/browser/chromeos/system_access.cc @@ -41,10 +41,6 @@ const char* kMachineOSInfoTool[] = { "cat", "/etc/lsb-release" }; const char kMachineOSInfoEq[] = "="; const char kMachineOSInfoDelim[] = "\n"; -// Command to get HWID and key. -const char kHwidKey[] = "hwid"; -const char* kHwidTool[] = { "cat", "/sys/devices/platform/chromeos_acpi/HWID" }; - // Command to get VPD info and key/value delimiters. const char* kVpdTool[] = { "cat", "/var/log/vpd_2.0.txt" }; const char kVpdEq[] = "="; @@ -203,7 +199,6 @@ void SystemAccessImpl::UpdateMachineStatistics() { kMachineOSInfoTool, kMachineOSInfoEq, kMachineOSInfoDelim); - parser.GetSingleValueFromTool(arraysize(kHwidTool), kHwidTool, kHwidKey); parser.ParseNameValuePairsFromTool( arraysize(kVpdTool), kVpdTool, kVpdEq, kVpdDelim); } diff --git a/chrome/browser/extensions/extension_info_private_api_chromeos.cc b/chrome/browser/extensions/extension_info_private_api_chromeos.cc index 67a40cb..7dc03049 100644 --- a/chrome/browser/extensions/extension_info_private_api_chromeos.cc +++ b/chrome/browser/extensions/extension_info_private_api_chromeos.cc @@ -14,6 +14,9 @@ using chromeos::NetworkLibrary; namespace { +// Name of machine statistic property with HWID. +const char kHardwareClass[] = "hardware_class"; + // Key which corresponds to the HWID setting. const char kPropertyHWID[] = "hwid"; @@ -49,7 +52,7 @@ bool GetChromeosInfoFunction::GetValue(const std::string& property_name, value->clear(); if (property_name == kPropertyHWID) { chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); - system->GetMachineStatistic(kPropertyHWID, value); + system->GetMachineStatistic(kHardwareClass, value); } else if (property_name == kPropertyHomeProvider) { if (CrosLibrary::Get()->EnsureLoaded()) { NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |