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 "extension_info_private_api_chromeos.h" | 5 #include "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/system_access.h" | 11 #include "chrome/browser/chromeos/system_access.h" |
11 | 12 |
12 using chromeos::CrosLibrary; | 13 using chromeos::CrosLibrary; |
13 using chromeos::NetworkLibrary; | 14 using chromeos::NetworkLibrary; |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // Name of machine statistic property with HWID. | 18 // Name of machine statistic property with HWID. |
18 const char kHardwareClass[] = "hardware_class"; | 19 const char kHardwareClass[] = "hardware_class"; |
19 | 20 |
20 // Key which corresponds to the HWID setting. | 21 // Key which corresponds to the HWID setting. |
21 const char kPropertyHWID[] = "hwid"; | 22 const char kPropertyHWID[] = "hwid"; |
22 | 23 |
23 // Key which corresponds to the home provider property. | 24 // Key which corresponds to the home provider property. |
24 const char kPropertyHomeProvider[] = "homeProvider"; | 25 const char kPropertyHomeProvider[] = "homeProvider"; |
25 | 26 |
| 27 // Key which corresponds to the initial_locale property. |
| 28 const char kPropertyInitialLocale[] = "initialLocale"; |
| 29 |
26 } // namespace | 30 } // namespace |
27 | 31 |
28 GetChromeosInfoFunction::GetChromeosInfoFunction() { | 32 GetChromeosInfoFunction::GetChromeosInfoFunction() { |
29 } | 33 } |
30 | 34 |
31 GetChromeosInfoFunction::~GetChromeosInfoFunction() { | 35 GetChromeosInfoFunction::~GetChromeosInfoFunction() { |
32 } | 36 } |
33 | 37 |
34 bool GetChromeosInfoFunction::RunImpl() { | 38 bool GetChromeosInfoFunction::RunImpl() { |
35 ListValue* list = NULL; | 39 ListValue* list = NULL; |
(...skipping 17 matching lines...) Expand all Loading... |
53 if (property_name == kPropertyHWID) { | 57 if (property_name == kPropertyHWID) { |
54 chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); | 58 chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); |
55 system->GetMachineStatistic(kHardwareClass, value); | 59 system->GetMachineStatistic(kHardwareClass, value); |
56 } else if (property_name == kPropertyHomeProvider) { | 60 } else if (property_name == kPropertyHomeProvider) { |
57 if (CrosLibrary::Get()->EnsureLoaded()) { | 61 if (CrosLibrary::Get()->EnsureLoaded()) { |
58 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); | 62 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); |
59 (*value) = netlib->GetCellularHomeCarrierId(); | 63 (*value) = netlib->GetCellularHomeCarrierId(); |
60 } else { | 64 } else { |
61 LOG(ERROR) << "CrosLibrary can't be loaded."; | 65 LOG(ERROR) << "CrosLibrary can't be loaded."; |
62 } | 66 } |
| 67 } else if (property_name == kPropertyInitialLocale) { |
| 68 *value = chromeos::WizardController::GetInitialLocale(); |
63 } else { | 69 } else { |
64 LOG(ERROR) << "Unknown property request: " << property_name; | 70 LOG(ERROR) << "Unknown property request: " << property_name; |
65 return false; | 71 return false; |
66 } | 72 } |
67 return true; | 73 return true; |
68 } | 74 } |
OLD | NEW |