| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_info_private_api_chromeos.h" | 5 #include "chrome/browser/extensions/extension_info_private_api_chromeos.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 9 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 11 #include "chrome/browser/chromeos/system_access.h" | 11 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 12 | 12 |
| 13 using chromeos::CrosLibrary; | 13 using chromeos::CrosLibrary; |
| 14 using chromeos::NetworkLibrary; | 14 using chromeos::NetworkLibrary; |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // Name of machine statistic property with HWID. | 18 // Name of machine statistic property with HWID. |
| 19 const char kHardwareClass[] = "hardware_class"; | 19 const char kHardwareClass[] = "hardware_class"; |
| 20 | 20 |
| 21 // Key which corresponds to the HWID setting. | 21 // Key which corresponds to the HWID setting. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 48 } | 48 } |
| 49 result_.reset(result.release()); | 49 result_.reset(result.release()); |
| 50 SendResponse(true); | 50 SendResponse(true); |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool GetChromeosInfoFunction::GetValue(const std::string& property_name, | 54 bool GetChromeosInfoFunction::GetValue(const std::string& property_name, |
| 55 std::string* value) { | 55 std::string* value) { |
| 56 value->clear(); | 56 value->clear(); |
| 57 if (property_name == kPropertyHWID) { | 57 if (property_name == kPropertyHWID) { |
| 58 chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); | 58 chromeos::system::StatisticsProvider* provider = |
| 59 system->GetMachineStatistic(kHardwareClass, value); | 59 chromeos::system::StatisticsProvider::GetInstance(); |
| 60 provider->GetMachineStatistic(kHardwareClass, value); |
| 60 } else if (property_name == kPropertyHomeProvider) { | 61 } else if (property_name == kPropertyHomeProvider) { |
| 61 if (CrosLibrary::Get()->EnsureLoaded()) { | 62 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 62 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); | 63 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |
| 63 (*value) = netlib->GetCellularHomeCarrierId(); | 64 (*value) = netlib->GetCellularHomeCarrierId(); |
| 64 } else { | 65 } else { |
| 65 LOG(ERROR) << "CrosLibrary can't be loaded."; | 66 LOG(ERROR) << "CrosLibrary can't be loaded."; |
| 66 } | 67 } |
| 67 } else if (property_name == kPropertyInitialLocale) { | 68 } else if (property_name == kPropertyInitialLocale) { |
| 68 *value = chromeos::WizardController::GetInitialLocale(); | 69 *value = chromeos::WizardController::GetInitialLocale(); |
| 69 } else { | 70 } else { |
| 70 LOG(ERROR) << "Unknown property request: " << property_name; | 71 LOG(ERROR) << "Unknown property request: " << property_name; |
| 71 return false; | 72 return false; |
| 72 } | 73 } |
| 73 return true; | 74 return true; |
| 74 } | 75 } |
| OLD | NEW |