| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 if (property_name == kPropertyInitialLocale) { | 250 if (property_name == kPropertyInitialLocale) { |
| 251 return new base::StringValue( | 251 return new base::StringValue( |
| 252 chromeos::StartupUtils::GetInitialLocale()); | 252 chromeos::StartupUtils::GetInitialLocale()); |
| 253 } | 253 } |
| 254 | 254 |
| 255 if (property_name == kPropertyBoard) { | 255 if (property_name == kPropertyBoard) { |
| 256 return new base::StringValue(base::SysInfo::GetLsbReleaseBoard()); | 256 return new base::StringValue(base::SysInfo::GetLsbReleaseBoard()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 if (property_name == kPropertyOwner) { | 259 if (property_name == kPropertyOwner) { |
| 260 return new base::FundamentalValue( | 260 return new base::Value( |
| 261 user_manager::UserManager::Get()->IsCurrentUserOwner()); | 261 user_manager::UserManager::Get()->IsCurrentUserOwner()); |
| 262 } | 262 } |
| 263 | 263 |
| 264 if (property_name == kPropertySessionType) { | 264 if (property_name == kPropertySessionType) { |
| 265 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) | 265 if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) |
| 266 return new base::StringValue(kSessionTypeKiosk); | 266 return new base::StringValue(kSessionTypeKiosk); |
| 267 if (ExtensionsBrowserClient::Get()->IsLoggedInAsPublicAccount()) | 267 if (ExtensionsBrowserClient::Get()->IsLoggedInAsPublicAccount()) |
| 268 return new base::StringValue(kSessionTypePublicSession); | 268 return new base::StringValue(kSessionTypePublicSession); |
| 269 return new base::StringValue(kSessionTypeNormal); | 269 return new base::StringValue(kSessionTypeNormal); |
| 270 } | 270 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (property_name == kPropertySupportedTimezones) { | 298 if (property_name == kPropertySupportedTimezones) { |
| 299 std::unique_ptr<base::ListValue> values = | 299 std::unique_ptr<base::ListValue> values = |
| 300 chromeos::system::GetTimezoneList(); | 300 chromeos::system::GetTimezoneList(); |
| 301 return values.release(); | 301 return values.release(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 const char* pref_name = GetBoolPrefNameForApiProperty(property_name.c_str()); | 304 const char* pref_name = GetBoolPrefNameForApiProperty(property_name.c_str()); |
| 305 if (pref_name) { | 305 if (pref_name) { |
| 306 return new base::FundamentalValue( | 306 return new base::Value( |
| 307 Profile::FromBrowserContext(context_)->GetPrefs()->GetBoolean( | 307 Profile::FromBrowserContext(context_)->GetPrefs()->GetBoolean( |
| 308 pref_name)); | 308 pref_name)); |
| 309 } | 309 } |
| 310 | 310 |
| 311 DLOG(ERROR) << "Unknown property request: " << property_name; | 311 DLOG(ERROR) << "Unknown property request: " << property_name; |
| 312 return NULL; | 312 return NULL; |
| 313 } | 313 } |
| 314 | 314 |
| 315 ChromeosInfoPrivateSetFunction::ChromeosInfoPrivateSetFunction() { | 315 ChromeosInfoPrivateSetFunction::ChromeosInfoPrivateSetFunction() { |
| 316 } | 316 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 336 param_value); | 336 param_value); |
| 337 } else { | 337 } else { |
| 338 return RespondNow(Error(kPropertyNotFound, param_name)); | 338 return RespondNow(Error(kPropertyNotFound, param_name)); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 return RespondNow(NoArguments()); | 342 return RespondNow(NoArguments()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace extensions | 345 } // namespace extensions |
| OLD | NEW |