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

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

Issue 776093004: Add device policy to disallow shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/policy/device_policy_decoder_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (container.has_guest_mode_enabled()) { 115 if (container.has_guest_mode_enabled()) {
116 policies->Set(key::kDeviceGuestModeEnabled, 116 policies->Set(key::kDeviceGuestModeEnabled,
117 POLICY_LEVEL_MANDATORY, 117 POLICY_LEVEL_MANDATORY,
118 POLICY_SCOPE_MACHINE, 118 POLICY_SCOPE_MACHINE,
119 new base::FundamentalValue( 119 new base::FundamentalValue(
120 container.guest_mode_enabled()), 120 container.guest_mode_enabled()),
121 NULL); 121 NULL);
122 } 122 }
123 } 123 }
124 124
125 if (policy.has_shutdown_allowed()) {
126 const em::ShutdownAllowedProto& container(policy.shutdown_allowed());
127 if (container.has_shutdown_allowed()) {
128 policies->Set(key::kDeviceShutdownAllowed, POLICY_LEVEL_MANDATORY,
129 POLICY_SCOPE_MACHINE,
130 new base::FundamentalValue(container.shutdown_allowed()),
131 NULL);
132 }
133 }
134
125 if (policy.has_show_user_names()) { 135 if (policy.has_show_user_names()) {
126 const em::ShowUserNamesOnSigninProto& container(policy.show_user_names()); 136 const em::ShowUserNamesOnSigninProto& container(policy.show_user_names());
127 if (container.has_show_user_names()) { 137 if (container.has_show_user_names()) {
128 policies->Set(key::kDeviceShowUserNamesOnSignin, 138 policies->Set(key::kDeviceShowUserNamesOnSignin,
129 POLICY_LEVEL_MANDATORY, 139 POLICY_LEVEL_MANDATORY,
130 POLICY_SCOPE_MACHINE, 140 POLICY_SCOPE_MACHINE,
131 new base::FundamentalValue( 141 new base::FundamentalValue(
132 container.show_user_names()), 142 container.show_user_names()),
133 NULL); 143 NULL);
134 } 144 }
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 DecodeLoginPolicies(policy, policies); 822 DecodeLoginPolicies(policy, policies);
813 DecodeKioskPolicies(policy, policies, install_attributes); 823 DecodeKioskPolicies(policy, policies, install_attributes);
814 DecodeNetworkPolicies(policy, policies, install_attributes); 824 DecodeNetworkPolicies(policy, policies, install_attributes);
815 DecodeReportingPolicies(policy, policies); 825 DecodeReportingPolicies(policy, policies);
816 DecodeAutoUpdatePolicies(policy, policies); 826 DecodeAutoUpdatePolicies(policy, policies);
817 DecodeAccessibilityPolicies(policy, policies); 827 DecodeAccessibilityPolicies(policy, policies);
818 DecodeGenericPolicies(policy, policies); 828 DecodeGenericPolicies(policy, policies);
819 } 829 }
820 830
821 } // namespace policy 831 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698