1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "chromeos/settings/cros_settings_names.h"
6 
7 namespace chromeos {
8 
9 const char kCrosSettingsPrefix[] = "cros.";
10 
11 // All cros.accounts.* settings are stored in SignedSettings.
12 const char kAccountsPrefAllowGuest[] = "cros.accounts.allowBWSI";
13 const char kAccountsPrefAllowNewUser[] = "cros.accounts.allowGuest";
14 const char kAccountsPrefShowUserNamesOnSignIn[] =
15     "cros.accounts.showUserNamesOnSignIn";
16 const char kAccountsPrefUsers[] = "cros.accounts.users";
17 const char kAccountsPrefEphemeralUsersEnabled[] =
18     "cros.accounts.ephemeralUsersEnabled";
19 const char kAccountsPrefDeviceLocalAccounts[] =
20     "cros.accounts.deviceLocalAccounts";
21 const char kAccountsPrefDeviceLocalAccountsKeyId[] = "id";
22 const char kAccountsPrefDeviceLocalAccountsKeyType[] = "type";
23 const char kAccountsPrefDeviceLocalAccountsKeyKioskAppId[] = "kiosk_app_id";
24 const char kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL[] =
25     "kiosk_app_update_url";
26 const char kAccountsPrefDeviceLocalAccountsKeyArcKioskPackage[] =
27     "arc_kiosk_package";
28 const char kAccountsPrefDeviceLocalAccountsKeyArcKioskClass[] =
29     "arc_kiosk_class";
30 const char kAccountsPrefDeviceLocalAccountsKeyArcKioskAction[] =
31     "arc_kiosk_action";
32 const char kAccountsPrefDeviceLocalAccountsKeyArcKioskDisplayName[] =
33     "arc_kiosk_display_name";
34 const char kAccountsPrefDeviceLocalAccountsKeyWebKioskUrl[] = "web_kiosk_url";
35 const char kAccountsPrefDeviceLocalAccountsKeyWebKioskTitle[] =
36     "web_kiosk_title";
37 const char kAccountsPrefDeviceLocalAccountsKeyWebKioskIconUrl[] =
38     "web_kiosk_icon_url";
39 const char kAccountsPrefDeviceLocalAccountAutoLoginId[] =
40     "cros.accounts.deviceLocalAccountAutoLoginId";
41 const char kAccountsPrefDeviceLocalAccountAutoLoginDelay[] =
42     "cros.accounts.deviceLocalAccountAutoLoginDelay";
43 const char kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled[] =
44     "cros.accounts.deviceLocalAccountAutoLoginBailoutEnabled";
45 const char kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline[] =
46     "cros.accounts.deviceLocalAccountPromptForNetworkWhenOffline";
47 // TODO(crbug.com/866790): Check it is not used anymore and remove it.
48 const char kAccountsPrefSupervisedUsersEnabled[] =
49     "cros.accounts.supervisedUsersEnabled";
50 const char kAccountsPrefTransferSAMLCookies[] =
51     "cros.accounts.transferSAMLCookies";
52 
53 // A string pref that specifies a domain name for the autocomplete option during
54 // user sign-in flow.
55 const char kAccountsPrefLoginScreenDomainAutoComplete[] =
56     "cros.accounts.login_screen_domain_auto_complete";
57 
58 // A boolean pref indicating whether all Family Link accounts are allowed on the
59 // device additionally to the accounts listed in |kAccountsPrefUsers| pref.
60 const char kAccountsPrefFamilyLinkAccountsAllowed[] =
61     "cros.accounts.family_link_allowed";
62 
63 // All cros.signed.* settings are stored in SignedSettings.
64 const char kSignedDataRoamingEnabled[] = "cros.signed.data_roaming_enabled";
65 
66 // True if auto-update was disabled by the system administrator.
67 const char kUpdateDisabled[] = "cros.system.updateDisabled";
68 
69 // True if a target version prefix is set by the system administrator.
70 const char kTargetVersionPrefix[] = "cros.system.targetVersionPrefix";
71 
72 // A list of strings which specifies allowed connection types for
73 // update.
74 const char kAllowedConnectionTypesForUpdate[] =
75     "cros.system.allowedConnectionTypesForUpdate";
76 
77 // The first constant refers to the user setting editable in the UI. The second
78 // refers to the timezone policy. This seperation is necessary to allow the user
79 // to temporarily change the timezone for the current session and reset it to
80 // the policy's value on logout.
81 const char kSystemTimezone[] = "cros.system.timezone";
82 const char kSystemTimezonePolicy[] = "cros.system.timezone_policy";
83 
84 // Value of kUse24HourClock user preference of device' owner.
85 // ChromeOS device uses this setting on login screen.
86 const char kSystemUse24HourClock[] = "cros.system.use_24hour_clock";
87 
88 const char kDeviceOwner[] = "cros.device.owner";
89 
90 const char kStatsReportingPref[] = "cros.metrics.reportingEnabled";
91 
92 const char kReleaseChannel[] = "cros.system.releaseChannel";
93 const char kReleaseChannelDelegated[] = "cros.system.releaseChannelDelegated";
94 const char kReleaseLtsTag[] = "cros.system.releaseLtsTag";
95 const char kDeviceChannelDowngradeBehavior[] =
96     "cros.system.channelDowngradeBehavior";
97 
98 // A boolean pref that indicates whether OS & firmware version info should be
99 // reported along with device policy requests.
100 const char kReportDeviceVersionInfo[] =
101     "cros.device_status.report_version_info";
102 
103 // A boolean pref that indicates whether device activity times should be
104 // recorded and reported along with device policy requests.
105 const char kReportDeviceActivityTimes[] =
106     "cros.device_status.report_activity_times";
107 
108 // A boolean pref that determines whether the board status should be
109 // included in status reports to the device management server.
110 const char kReportDeviceBoardStatus[] =
111     "cros.device_status.report_board_status";
112 
113 // A boolean pref that indicates whether the state of the dev mode switch at
114 // boot should be reported along with device policy requests.
115 const char kReportDeviceBootMode[] = "cros.device_status.report_boot_mode";
116 
117 // A boolean pref that determines whether the device CPU information should be
118 // included in status reports to the device management server.
119 const char kReportDeviceCpuInfo[] = "cros.device_status.report_cpu_info";
120 
121 // A boolean pref that determines whether the device timezone information should
122 // be included in status reports to the device management server.
123 const char kReportDeviceTimezoneInfo[] =
124     "cros.device_status.report_timezone_info";
125 
126 // A boolean pref that determines whether the device memory information should
127 // be included in status reports to the device management server.
128 const char kReportDeviceMemoryInfo[] = "cros.device_status.report_memory_info";
129 
130 // A boolean pref that determines whether the device backlight information
131 // should be included in status reports to the device management server.
132 const char kReportDeviceBacklightInfo[] =
133     "cros.device_status.report_backlight_info";
134 
135 // A boolean pref that indicates whether the current location should be reported
136 // along with device policy requests.
137 const char kReportDeviceLocation[] = "cros.device_status.report_location";
138 
139 // Determines whether the device reports network interface types and addresses
140 // in device status reports to the device management server.
141 const char kReportDeviceNetworkInterfaces[] =
142     "cros.device_status.report_network_interfaces";
143 
144 // A boolean pref that determines whether the device power status should be
145 // included in status reports to the device management server.
146 const char kReportDevicePowerStatus[] =
147     "cros.device_status.report_power_status";
148 
149 // A boolean pref that determines whether the storage status should be
150 // included in status reports to the device management server.
151 const char kReportDeviceStorageStatus[] =
152     "cros.device_status.report_storage_status";
153 
154 // Determines whether the device reports recently logged in users in device
155 // status reports to the device management server.
156 const char kReportDeviceUsers[] = "cros.device_status.report_users";
157 
158 // Determines whether the device reports hardware status (CPU utilization,
159 // disk space, etc) in device status reports to the device management server.
160 const char kReportDeviceHardwareStatus[] =
161     "cros.device_status.report_hardware_status";
162 
163 // Determines whether the device reports kiosk session status (app IDs,
164 // versions, etc) in device status reports to the device management server.
165 const char kReportDeviceSessionStatus[] =
166     "cros.device_status.report_session_status";
167 
168 // Determines whether the device reports display and graphics statuses to the
169 // device_management server.
170 const char kReportDeviceGraphicsStatus[] =
171     "cros.device_status.report_graphics_status";
172 
173 // Determines whether the device reports crash report information to the device
174 // management server.
175 const char kReportDeviceCrashReportInfo[] =
176     "cros.device_status.report_crash_report_info";
177 
178 // Determines whether the device reports os update status (update status,
179 // new platform version and new required platform version of the auto
180 // launched kiosk app).
181 const char kReportOsUpdateStatus[] =
182     "cros.device_status.report_os_update_status";
183 
184 // Determines whether the device reports the current running kiosk app (
185 // its app ID, version and required platform version).
186 const char kReportRunningKioskApp[] =
187     "cros.device_status.report_running_kiosk_app";
188 
189 // How frequently device status reports are uploaded, in milliseconds.
190 const char kReportUploadFrequency[] =
191     "cros.device_status.report_upload_frequency";
192 
193 // A boolean pref that indicates whether user app information and activity times
194 // should be recorded and reported along with device policy requests.
195 const char kReportDeviceAppInfo[] = "cros.device_status.report_device_app_info";
196 
197 // A boolean pref that determines whether the device Bluetooth information
198 // should be included in status reports to the device management server.
199 const char kReportDeviceBluetoothInfo[] =
200     "cros.device_status.report_device_bluetooth_info";
201 
202 // A boolean pref that determines whether the device fan information should be
203 // included in status reports to the device management server.
204 const char kReportDeviceFanInfo[] = "cros.device_status.report_device_fan_info";
205 
206 // A boolean pref that determines whether the device's VPD information should be
207 // included in status reports to the device management server.
208 const char kReportDeviceVpdInfo[] = "cros.device_status.report_device_vpd_info";
209 
210 // A boolean pref that determines whether the device's system information should
211 // be included in status reports to the device management server.
212 const char kReportDeviceSystemInfo[] =
213     "cros.device_status.report_device_system_info";
214 
215 // Determines whether heartbeats should be sent to the policy service via
216 // the GCM channel.
217 const char kHeartbeatEnabled[] = "cros.device_status.heartbeat_enabled";
218 
219 // How frequently heartbeats are sent up, in milliseconds.
220 const char kHeartbeatFrequency[] = "cros.device_status.heartbeat_frequency";
221 
222 // Determines whether system logs should be sent to the management server.
223 const char kSystemLogUploadEnabled[] =
224     "cros.device_status.system_log_upload_enabled";
225 
226 // This policy should not appear in the protobuf ever but is used internally to
227 // signal that we are running in a "safe-mode" for policy recovery.
228 const char kPolicyMissingMitigationMode[] =
229     "cros.internal.policy_mitigation_mode";
230 
231 // A boolean pref that indicates whether users are allowed to redeem offers
232 // through Chrome OS Registration.
233 const char kAllowRedeemChromeOsRegistrationOffers[] =
234     "cros.echo.allow_redeem_chrome_os_registration_offers";
235 
236 // A list pref storing the flags that need to be applied to the browser upon
237 // start-up.
238 const char kStartUpFlags[] = "cros.startup_flags";
239 
240 // A string pref for the restrict parameter to be appended to the Variations URL
241 // when pinging the Variations server.
242 const char kVariationsRestrictParameter[] =
243     "cros.variations_restrict_parameter";
244 
245 // A boolean pref that indicates whether enterprise attestation is enabled for
246 // the device.
247 const char kDeviceAttestationEnabled[] = "cros.device.attestation_enabled";
248 
249 // A boolean pref that indicates whether attestation for content protection is
250 // enabled for the device.
251 const char kAttestationForContentProtectionEnabled[] =
252     "cros.device.attestation_for_content_protection_enabled";
253 
254 // The service account identity for device-level service accounts on
255 // enterprise-enrolled devices.
256 const char kServiceAccountIdentity[] = "cros.service_account_identity";
257 
258 // A boolean pref that indicates whether the device has been disabled by its
259 // owner. If so, the device will show a warning screen and will not allow any
260 // sessions to be started.
261 const char kDeviceDisabled[] = "cros.device_disabled";
262 
263 // A string pref containing the message that should be shown to the user when
264 // the device is disabled.
265 const char kDeviceDisabledMessage[] = "cros.disabled_state.message";
266 
267 // A boolean pref that indicates whether the device automatically reboots when
268 // the user initiates a shutdown via an UI element.  If set to true, all
269 // shutdown buttons in the UI will be replaced by reboot buttons.
270 const char kRebootOnShutdown[] = "cros.device.reboot_on_shutdown";
271 
272 // An integer pref that specifies the limit of the device's extension cache
273 // size in bytes.
274 const char kExtensionCacheSize[] = "cros.device.extension_cache_size";
275 
276 // A dictionary pref that sets the display resolution.
277 // Pref format:
278 // {
279 //   "external_width": int,
280 //   "external_height": int,
281 //   "external_use_native": bool,
282 //   "external_scale_percentage": int,
283 //   "internal_scale_percentage": int,
284 //   "recommended": bool
285 // }
286 const char kDeviceDisplayResolution[] = "cros.device_display_resolution";
287 const char kDeviceDisplayResolutionKeyExternalWidth[] = "external_width";
288 const char kDeviceDisplayResolutionKeyExternalHeight[] = "external_height";
289 const char kDeviceDisplayResolutionKeyExternalScale[] =
290     "external_scale_percentage";
291 const char kDeviceDisplayResolutionKeyExternalUseNative[] =
292     "external_use_native";
293 const char kDeviceDisplayResolutionKeyInternalScale[] =
294     "internal_scale_percentage";
295 const char kDeviceDisplayResolutionKeyRecommended[] = "recommended";
296 
297 // An integer pref that sets the display rotation at startup to a certain
298 // value, overriding the user value:
299 // 0 = 0 degrees rotation
300 // 1 = 90 degrees clockwise rotation
301 // 2 = 180 degrees rotation
302 // 3 = 270 degrees clockwise rotation
303 const char kDisplayRotationDefault[] = "cros.display_rotation_default";
304 
305 // An integer pref that sets the behavior of the login authentication flow.
306 // 0 = authentication using the default GAIA flow.
307 // 1 = authentication using an interstitial screen that offers the user to go
308 // ahead via the SAML IdP of the device's enrollment domain, or go back to the
309 // normal GAIA login flow.
310 const char kLoginAuthenticationBehavior[] =
311     "cros.device.login_authentication_behavior";
312 
313 // A boolean pref that indicates whether bluetooth should be allowed on the
314 // device.
315 const char kAllowBluetooth[] = "cros.device.allow_bluetooth";
316 
317 // A boolean pref that indicates whether WiFi should be allowed on the
318 // device.
319 const char kDeviceWiFiAllowed[] = "cros.device.wifi_allowed";
320 
321 // A boolean pref to enable any pings or requests to the Quirks Server.
322 const char kDeviceQuirksDownloadEnabled[] =
323     "cros.device.quirks_download_enabled";
324 
325 // A list pref storing the security origins allowed to access the webcam
326 // during SAML logins.
327 const char kLoginVideoCaptureAllowedUrls[] =
328     "cros.device.login_video_capture_allowed_urls";
329 
330 // A list pref storing the apps or extensions to install on the login page. It
331 // is a list of strings, each string contains an extension ID and an update URL,
332 // delimited by a semicolon. This preference is set by an admin policy.
333 const char kDeviceLoginScreenExtensions[] =
334     "cros.device.login_screen_extensions";
335 
336 // A list pref specifying the locales allowed on the login screen. Currently
337 // only the first value is used, as the single locale allowed on the login
338 // screen.
339 const char kDeviceLoginScreenLocales[] = "cros.device_login_screen_locales";
340 
341 // A list pref containing the input method IDs allowed on the login screen.
342 const char kDeviceLoginScreenInputMethods[] =
343     "cros.device_login_screen_input_methods";
344 
345 // A boolean pref that indicates whether the system information is forcedly
346 // shown (or hidden) on the login screen.
347 const char kDeviceLoginScreenSystemInfoEnforced[] =
348     "cros.device_login_screen_system_info_enforced";
349 
350 // A boolean pref that indicates whether to show numeric keyboard for entering
351 // password or not.
352 const char kDeviceShowNumericKeyboardForPassword[] =
353     "cros.device_show_numeric_keyboard_for_password";
354 
355 // A boolean pref that matches enable-per-user-time-zone chrome://flags value.
356 const char kPerUserTimezoneEnabled[] = "cros.flags.per_user_timezone_enabled";
357 
358 // A boolean pref that matches enable-fine-graned-time-zone-detection
359 // chrome://flags value.
360 const char kFineGrainedTimeZoneResolveEnabled[] =
361     "cros.flags.fine_grained_time_zone_detection_enabled";
362 
363 // A dictionary pref containing time intervals and ignored policies.
364 // It's used to allow less restricted usage of Chrome OS during off-hours.
365 // This pref is set by an admin policy.
366 // Pref format:
367 // { "timezone" : string,
368 //   "intervals" : list of Intervals,
369 //   "ignored_policies" : string list }
370 // Interval dictionary format:
371 // { "start" : WeeklyTime,
372 //   "end" : WeeklyTime }
373 // WeeklyTime dictionary format:
374 // { "weekday" : int # value is from 1 to 7 (1 = Monday, 2 = Tuesday, etc.)
375 //   "time" : int # in milliseconds from the beginning of the day.
376 // }
377 const char kDeviceOffHours[] = "cros.device_off_hours";
378 
379 // An enum specifying the access policy device printers should observe.
380 const char kDevicePrintersAccessMode[] = "cros.device.printers_access_mode";
381 // A list of strings representing device printer ids for which access is
382 // restricted.
383 const char kDevicePrintersBlocklist[] = "cros.device.printers_blocklist";
384 // A list of strings representing the list of device printer ids which are
385 // accessible.
386 const char kDevicePrintersAllowlist[] = "cros.device.printers_allowlist";
387 
388 // A dictionary containing parameters controlling the TPM firmware update
389 // functionality.
390 const char kTPMFirmwareUpdateSettings[] = "cros.tpm_firmware_update_settings";
391 
392 // A dictionary containing a list of entries in JSON form representing the
393 // minimum version of Chrome OS along with warning times required to allow user
394 // sign in or stay in session. If the list is empty no restrictions will be
395 // applied.
396 const char kDeviceMinimumVersion[] = "cros.device.min_version";
397 
398 // String shown on the update required dialog on the the login screen containing
399 // return instructions from the device administrator. It is shown when update
400 // is required but the device has reached auto update expiration.
401 const char kDeviceMinimumVersionAueMessage[] =
402     "cros.device.min_version_aue_message";
403 
404 // String indicating what name should be advertised for casting to.
405 // If the string is empty or blank the system name will be used.
406 const char kCastReceiverName[] = "cros.device.cast_receiver.name";
407 
408 // A boolean pref that indicates whether unaffiliated users are allowed to
409 // use ARC.
410 const char kUnaffiliatedArcAllowed[] = "cros.device.unaffiliated_arc_allowed";
411 
412 // String that is used as a template for generating device hostname (that is
413 // used in DHCP requests).
414 // If the string contains either ASSET_ID, SERIAL_NUM or MAC_ADDR values,
415 // they will be substituted for real values.
416 // If the string is empty or blank, or the resulting hostname is not valid
417 // as per RFC 1035, then no hostname will be used.
418 const char kDeviceHostnameTemplate[] = "cros.network.hostname_template";
419 
420 // A boolean pref that indicates whether running virtual machines on Chrome OS
421 // is allowed.
422 const char kVirtualMachinesAllowed[] = "cros.device.virtual_machines_allowed";
423 
424 // An enum specifying the authentication type for newly added users which log in
425 // via SAML. See the SamlLoginAuthenticationTypeProto proto message for the list
426 // of possible values.
427 const char kSamlLoginAuthenticationType[] =
428     "cros.device.saml_login_authentication_type";
429 
430 // A list of time intervals during which the admin has disallowed automatic
431 // update checks.
432 const char kDeviceAutoUpdateTimeRestrictions[] =
433     "cros.system.autoUpdateTimeRestrictions";
434 
435 // A boolean pref that indicates whether running Crostini on Chrome OS is
436 // allowed for unaffiliated user.
437 const char kDeviceUnaffiliatedCrostiniAllowed[] =
438     "cros.device.unaffiliated_crostini_allowed";
439 
440 // A boolean pref that indicates whether PluginVm is allowed to run on this
441 // device.
442 const char kPluginVmAllowed[] = "cros.device.plugin_vm_allowed";
443 // A string pref that specifies PluginVm license key for this device.
444 const char kPluginVmLicenseKey[] = "cros.device.plugin_vm_license_key";
445 
446 // An enum pref specifying the case when device needs to reboot on user sign
447 // out.
448 const char kDeviceRebootOnUserSignout[] = "cros.device.reboot_on_user_signout";
449 
450 // A boolean pref that indicates whether running wilco diagnostics and telemetry
451 // controller on Chrome OS is allowed.
452 const char kDeviceWilcoDtcAllowed[] = "cros.device.wilco_dtc_allowed";
453 
454 // An enum pref that specifies the device dock MAC address source.
455 const char kDeviceDockMacAddressSource[] =
456     "cros.device.device_dock_mac_address_source";
457 
458 // A dictionary pref that mandates the recurring schedule for update checks. The
459 // schedule is followed even if the device is suspended, however, it's not
460 // respected when the device is shutdown.
461 const char kDeviceScheduledUpdateCheck[] =
462     "cros.device.device_scheduled_update_check";
463 
464 // An enum pref that configures the operation mode of the built-in 2nd factor
465 // authenticator.
466 const char kDeviceSecondFactorAuthenticationMode[] =
467     "cros.device.device_second_factor_authentication_mode";
468 
469 // A boolean pref specifying if the device is allowed to powerwash.
470 const char kDevicePowerwashAllowed[] = "cros.device.device_powerwash_allowed";
471 
472 // A list pref storing URL patterns that are allowed for device attestation
473 // during SAML authentication.
474 extern const char kDeviceWebBasedAttestationAllowedUrls[] =
475     "cros.device.device_web_based_attestation_allowed_urls";
476 
477 // A dictionary containing parameters controlling the availability of
478 // System-proxy service and the web proxy credentials for system services
479 // connecting through System-proxy.
480 const char kSystemProxySettings[] = "cros.system_proxy_settings";
481 const char kSystemProxySettingsKeyEnabled[] = "system_proxy_enabled";
482 const char kSystemProxySettingsKeySystemServicesUsername[] =
483     "system_services_username";
484 const char kSystemProxySettingsKeySystemServicesPassword[] =
485     "system_services_password";
486 const char kSystemProxySettingsKeyAuthSchemes[] =
487     "policy_credentials_auth_schemes";
488 
489 // An enum pref that indicates whether adb sideloading is allowed on this device
490 const char kDeviceCrostiniArcAdbSideloadingAllowed[] =
491     "cros.device.crostini_arc_adb_sideloading_allowed";
492 
493 // A boolean pref controlling showing the low disk space notification.
494 const char kDeviceShowLowDiskSpaceNotification[] =
495     "cros.device.show_low_disk_space_notification";
496 }  // namespace chromeos
497