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

Unified Diff: chrome/browser/chromeos/settings/device_settings_provider.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc
index 7c2196f563169d377d386ca0f534efcb83240d41..6ca169fcce89449e87d097469aa8e223808b7302 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -39,48 +39,49 @@ namespace {
// List of settings handled by the DeviceSettingsProvider.
const char* const kKnownSettings[] = {
- kAccountsPrefAllowGuest,
- kAccountsPrefAllowNewUser,
- kAccountsPrefDeviceLocalAccounts,
- kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled,
- kAccountsPrefDeviceLocalAccountAutoLoginDelay,
- kAccountsPrefDeviceLocalAccountAutoLoginId,
- kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline,
- kAccountsPrefEphemeralUsersEnabled,
- kAccountsPrefShowUserNamesOnSignIn,
- kAccountsPrefSupervisedUsersEnabled,
- kAccountsPrefTransferSAMLCookies,
- kAccountsPrefUsers,
- kAllowRedeemChromeOsRegistrationOffers,
- kAllowedConnectionTypesForUpdate,
- kAppPack,
- kAttestationForContentProtectionEnabled,
- kDeviceAttestationEnabled,
- kDeviceOwner,
- kIdleLogoutTimeout,
- kIdleLogoutWarningDuration,
- kPolicyMissingMitigationMode,
- kReleaseChannel,
- kReleaseChannelDelegated,
- kReportDeviceActivityTimes,
- kReportDeviceBootMode,
- kReportDeviceLocation,
- kReportDeviceNetworkInterfaces,
- kReportDeviceUsers,
- kReportDeviceVersionInfo,
- kScreenSaverExtensionId,
- kScreenSaverTimeout,
- kServiceAccountIdentity,
- kSignedDataRoamingEnabled,
- kStartUpFlags,
- kStartUpUrls,
- kStatsReportingPref,
- kSystemTimezonePolicy,
- kSystemUse24HourClock,
- kUpdateDisabled,
- kVariationsRestrictParameter,
- kDeviceDisabled,
- kDeviceDisabledMessage,
+ kAccountsPrefAllowGuest,
Daniel Erat 2014/12/05 19:06:11 did clang-format suggest this change?
cschuet (SLOW) 2014/12/09 08:50:11 Oh, yes I didn't even pay attention to this. clang
Daniel Erat 2014/12/09 16:00:36 it's okay with me if you leave it at four. i think
+ kAccountsPrefAllowNewUser,
+ kAccountsPrefDeviceLocalAccounts,
+ kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled,
+ kAccountsPrefDeviceLocalAccountAutoLoginDelay,
+ kAccountsPrefDeviceLocalAccountAutoLoginId,
+ kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline,
+ kAccountsPrefEphemeralUsersEnabled,
+ kAccountsPrefShowUserNamesOnSignIn,
+ kAccountsPrefSupervisedUsersEnabled,
+ kAccountsPrefTransferSAMLCookies,
+ kAccountsPrefUsers,
+ kAllowRedeemChromeOsRegistrationOffers,
+ kAllowedConnectionTypesForUpdate,
+ kAppPack,
+ kAttestationForContentProtectionEnabled,
+ kDeviceAttestationEnabled,
+ kDeviceOwner,
+ kIdleLogoutTimeout,
+ kIdleLogoutWarningDuration,
+ kPolicyMissingMitigationMode,
+ kReleaseChannel,
+ kReleaseChannelDelegated,
+ kReportDeviceActivityTimes,
+ kReportDeviceBootMode,
+ kReportDeviceLocation,
+ kReportDeviceNetworkInterfaces,
+ kReportDeviceUsers,
+ kReportDeviceVersionInfo,
+ kScreenSaverExtensionId,
+ kScreenSaverTimeout,
+ kServiceAccountIdentity,
+ kSignedDataRoamingEnabled,
+ kStartUpFlags,
+ kStartUpUrls,
+ kStatsReportingPref,
+ kSystemTimezonePolicy,
+ kSystemUse24HourClock,
+ kUpdateDisabled,
+ kVariationsRestrictParameter,
+ kDeviceDisabled,
+ kDeviceDisabledMessage,
+ kShutdownAllowed,
};
bool HasOldMetricsFile() {
@@ -120,6 +121,10 @@ void DecodeLoginPolicies(
}
new_values_cache->SetBoolean(
+ kShutdownAllowed, !policy.has_shutdown_allowed() ||
+ policy.shutdown_allowed().shutdown_allowed());
Daniel Erat 2014/12/05 19:06:11 this indenting is weird; please follow the style t
cschuet (SLOW) 2014/12/08 14:37:43 Done.
+
+ new_values_cache->SetBoolean(
kAccountsPrefAllowGuest,
!policy.has_guest_mode_enabled() ||
!policy.guest_mode_enabled().has_guest_mode_enabled() ||

Powered by Google App Engine
This is Rietveld 408576698