| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/extensions/info_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/info_private_api.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/startup_utils.h" |
| 10 #include "chrome/browser/chromeos/login/user_manager.h" | 11 #include "chrome/browser/chromeos/login/user_manager.h" |
| 11 #include "chrome/browser/chromeos/login/wizard_controller.h" | |
| 12 #include "chrome/browser/chromeos/system/statistics_provider.h" | 12 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 13 | 13 |
| 14 using chromeos::CrosLibrary; | 14 using chromeos::CrosLibrary; |
| 15 using chromeos::NetworkLibrary; | 15 using chromeos::NetworkLibrary; |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Name of machine statistic property with HWID. | 21 // Name of machine statistic property with HWID. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 std::string hwid; | 69 std::string hwid; |
| 70 chromeos::system::StatisticsProvider* provider = | 70 chromeos::system::StatisticsProvider* provider = |
| 71 chromeos::system::StatisticsProvider::GetInstance(); | 71 chromeos::system::StatisticsProvider::GetInstance(); |
| 72 provider->GetMachineStatistic(kHardwareClass, &hwid); | 72 provider->GetMachineStatistic(kHardwareClass, &hwid); |
| 73 return new base::StringValue(hwid); | 73 return new base::StringValue(hwid); |
| 74 } else if (property_name == kPropertyHomeProvider) { | 74 } else if (property_name == kPropertyHomeProvider) { |
| 75 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); | 75 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |
| 76 return new base::StringValue(netlib->GetCellularHomeCarrierId()); | 76 return new base::StringValue(netlib->GetCellularHomeCarrierId()); |
| 77 } else if (property_name == kPropertyInitialLocale) { | 77 } else if (property_name == kPropertyInitialLocale) { |
| 78 return new base::StringValue( | 78 return new base::StringValue( |
| 79 chromeos::WizardController::GetInitialLocale()); | 79 chromeos::StartupUtils::GetInitialLocale()); |
| 80 } else if (property_name == kPropertyBoard) { | 80 } else if (property_name == kPropertyBoard) { |
| 81 std::string board; | 81 std::string board; |
| 82 chromeos::system::StatisticsProvider* provider = | 82 chromeos::system::StatisticsProvider* provider = |
| 83 chromeos::system::StatisticsProvider::GetInstance(); | 83 chromeos::system::StatisticsProvider::GetInstance(); |
| 84 provider->GetMachineStatistic(kPropertyReleaseBoard, &board); | 84 provider->GetMachineStatistic(kPropertyReleaseBoard, &board); |
| 85 return new base::StringValue(board); | 85 return new base::StringValue(board); |
| 86 } else if (property_name == kPropertyOwner) { | 86 } else if (property_name == kPropertyOwner) { |
| 87 return Value::CreateBooleanValue( | 87 return Value::CreateBooleanValue( |
| 88 chromeos::UserManager::Get()->IsCurrentUserOwner()); | 88 chromeos::UserManager::Get()->IsCurrentUserOwner()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 DLOG(ERROR) << "Unknown property request: " << property_name; | 91 DLOG(ERROR) << "Unknown property request: " << property_name; |
| 92 return NULL; | 92 return NULL; |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace extensions | 95 } // namespace extensions |
| OLD | NEW |