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

Side by Side Diff: chrome/browser/policy/device_policy_decoder_chromeos.cc

Issue 12452003: Move pref backing up flags from local state to device settings on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 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 | Annotate | Revision Log
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/policy/device_policy_decoder_chromeos.h" 5 #include "chrome/browser/policy/device_policy_decoder_chromeos.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 const em::AllowRedeemChromeOsRegistrationOffersProto& container( 418 const em::AllowRedeemChromeOsRegistrationOffersProto& container(
419 policy.allow_redeem_offers()); 419 policy.allow_redeem_offers());
420 if (container.has_allow_redeem_offers()) { 420 if (container.has_allow_redeem_offers()) {
421 policies->Set(key::kDeviceAllowRedeemChromeOsRegistrationOffers, 421 policies->Set(key::kDeviceAllowRedeemChromeOsRegistrationOffers,
422 POLICY_LEVEL_MANDATORY, 422 POLICY_LEVEL_MANDATORY,
423 POLICY_SCOPE_MACHINE, 423 POLICY_SCOPE_MACHINE,
424 Value::CreateBooleanValue( 424 Value::CreateBooleanValue(
425 container.allow_redeem_offers())); 425 container.allow_redeem_offers()));
426 } 426 }
427 } 427 }
428
429 if (policy.has_start_up_flags()) {
430 const em::StartUpFlagsProto& container(policy.start_up_flags());
431 if (container.flags_size()) {
432 ListValue* flags = new ListValue();
433 RepeatedPtrField<std::string>::const_iterator entry;
434 for (entry = container.flags().begin();
435 entry != container.flags().end();
436 ++entry) {
437 flags->Append(Value::CreateStringValue(*entry));
438 }
439 policies->Set(key::kDeviceStartUpFlags,
440 POLICY_LEVEL_MANDATORY,
441 POLICY_SCOPE_MACHINE,
442 flags);
443 }
444 }
428 } 445 }
429 446
430 } // namespace 447 } // namespace
431 448
432 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, 449 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy,
433 PolicyMap* policies, 450 PolicyMap* policies,
434 EnterpriseInstallAttributes* install_attributes) { 451 EnterpriseInstallAttributes* install_attributes) {
435 // Decode the various groups of policies. 452 // Decode the various groups of policies.
436 DecodeLoginPolicies(policy, policies); 453 DecodeLoginPolicies(policy, policies);
437 DecodeKioskPolicies(policy, policies, install_attributes); 454 DecodeKioskPolicies(policy, policies, install_attributes);
438 DecodeNetworkPolicies(policy, policies, install_attributes); 455 DecodeNetworkPolicies(policy, policies, install_attributes);
439 DecodeReportingPolicies(policy, policies); 456 DecodeReportingPolicies(policy, policies);
440 DecodeAutoUpdatePolicies(policy, policies); 457 DecodeAutoUpdatePolicies(policy, policies);
441 DecodeGenericPolicies(policy, policies); 458 DecodeGenericPolicies(policy, policies);
442 } 459 }
443 460
444 } // namespace policy 461 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_provider.cc ('k') | chrome/browser/policy/proto/chrome_device_policy.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698