Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/browser/chromeos/extensions/info_private_api.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698