| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/app_mode/app_mode_utils.h" | 11 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/login/startup_utils.h" | 13 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 14 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 14 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 16 #include "chrome/browser/chromeos/settings/cros_settings.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 17 #include "chrome/browser/chromeos/system/timezone_util.h" | 16 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 20 #include "chromeos/network/device_state.h" | 19 #include "chromeos/network/device_state.h" |
| 21 #include "chromeos/network/network_handler.h" | 20 #include "chromeos/network/network_handler.h" |
| 22 #include "chromeos/network/network_state_handler.h" | 21 #include "chromeos/network/network_state_handler.h" |
| 23 #include "chromeos/settings/cros_settings_names.h" | 22 #include "chromeos/settings/cros_settings_names.h" |
| 24 #include "chromeos/system/statistics_provider.h" | 23 #include "chromeos/system/statistics_provider.h" |
| 25 #include "components/metrics/metrics_service.h" | 24 #include "components/metrics/metrics_service.h" |
| 25 #include "components/user_manager/user_manager.h" |
| 26 #include "extensions/common/error_utils.h" | 26 #include "extensions/common/error_utils.h" |
| 27 #include "third_party/cros_system_api/dbus/service_constants.h" | 27 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 28 | 28 |
| 29 using chromeos::NetworkHandler; | 29 using chromeos::NetworkHandler; |
| 30 | 30 |
| 31 namespace extensions { | 31 namespace extensions { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 // Key which corresponds to the HWID setting. | 35 // Key which corresponds to the HWID setting. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 if (cellular_device) | 175 if (cellular_device) |
| 176 home_provider_id = cellular_device->home_provider_id(); | 176 home_provider_id = cellular_device->home_provider_id(); |
| 177 return new base::StringValue(home_provider_id); | 177 return new base::StringValue(home_provider_id); |
| 178 } else if (property_name == kPropertyInitialLocale) { | 178 } else if (property_name == kPropertyInitialLocale) { |
| 179 return new base::StringValue( | 179 return new base::StringValue( |
| 180 chromeos::StartupUtils::GetInitialLocale()); | 180 chromeos::StartupUtils::GetInitialLocale()); |
| 181 } else if (property_name == kPropertyBoard) { | 181 } else if (property_name == kPropertyBoard) { |
| 182 return new base::StringValue(base::SysInfo::GetLsbReleaseBoard()); | 182 return new base::StringValue(base::SysInfo::GetLsbReleaseBoard()); |
| 183 } else if (property_name == kPropertyOwner) { | 183 } else if (property_name == kPropertyOwner) { |
| 184 return new base::FundamentalValue( | 184 return new base::FundamentalValue( |
| 185 chromeos::UserManager::Get()->IsCurrentUserOwner()); | 185 user_manager::UserManager::Get()->IsCurrentUserOwner()); |
| 186 } else if (property_name == kPropertyClientId) { | 186 } else if (property_name == kPropertyClientId) { |
| 187 return new base::StringValue(GetClientId()); | 187 return new base::StringValue(GetClientId()); |
| 188 } else if (property_name == kPropertyTimezone) { | 188 } else if (property_name == kPropertyTimezone) { |
| 189 return chromeos::CrosSettings::Get()->GetPref( | 189 return chromeos::CrosSettings::Get()->GetPref( |
| 190 chromeos::kSystemTimezone)->DeepCopy(); | 190 chromeos::kSystemTimezone)->DeepCopy(); |
| 191 } else if (property_name == kPropertySupportedTimezones) { | 191 } else if (property_name == kPropertySupportedTimezones) { |
| 192 scoped_ptr<base::ListValue> values = chromeos::system::GetTimezoneList(); | 192 scoped_ptr<base::ListValue> values = chromeos::system::GetTimezoneList(); |
| 193 return values.release(); | 193 return values.release(); |
| 194 } else { | 194 } else { |
| 195 const char* pref_name = | 195 const char* pref_name = |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } else { | 230 } else { |
| 231 error_ = ErrorUtils::FormatErrorMessage(kPropertyNotFound, param_name); | 231 error_ = ErrorUtils::FormatErrorMessage(kPropertyNotFound, param_name); |
| 232 return false; | 232 return false; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 return true; | 236 return true; |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace extensions | 239 } // namespace extensions |
| OLD | NEW |