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

Unified Diff: chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc

Issue 2652793003: Add login screen locale and input method device policies (Closed)
Patch Set: Rebase. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc b/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc
index 301e4aa8c73a30b303da1920d885fb82993fabb1..7e1dc1e42ca2fd867858df6c44cdee83aa158420 100644
--- a/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc
+++ b/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc
@@ -332,6 +332,56 @@ void DecodeLoginPolicies(const em::ChromeDeviceSettingsProto& policy,
policies->Set(key::kLoginApps, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
POLICY_SOURCE_CLOUD, std::move(login_apps), nullptr);
}
+
+ if (policy.has_login_screen_power_management()) {
+ const em::LoginScreenPowerManagementProto& container(
+ policy.login_screen_power_management());
+ if (container.has_login_screen_power_management()) {
+ std::unique_ptr<base::Value> decoded_json;
+ decoded_json = DecodeJsonStringAndDropUnknownBySchema(
+ container.login_screen_power_management(),
+ key::kDeviceLoginScreenPowerManagement);
+ if (decoded_json) {
+ policies->Set(key::kDeviceLoginScreenPowerManagement,
+ POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
+ POLICY_SOURCE_CLOUD, std::move(decoded_json), nullptr);
+ }
+ }
+ }
+
+ if (policy.has_login_screen_domain_auto_complete()) {
+ const em::LoginScreenDomainAutoCompleteProto& container(
+ policy.login_screen_domain_auto_complete());
+ policies->Set(key::kDeviceLoginScreenDomainAutoComplete,
+ POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::StringValue>(
+ container.login_screen_domain_auto_complete()),
+ nullptr);
+ }
+
+ if (policy.has_login_screen_locales()) {
+ std::unique_ptr<base::ListValue> locales(new base::ListValue);
+ const em::LoginScreenLocalesProto& login_screen_locales(
+ policy.login_screen_locales());
+ for (const auto& locale : login_screen_locales.login_screen_locales())
+ locales->AppendString(locale);
+ policies->Set(key::kDeviceLoginScreenLocales, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, std::move(locales),
+ nullptr);
+ }
+
+ if (policy.has_login_screen_input_methods()) {
+ std::unique_ptr<base::ListValue> input_methods(new base::ListValue);
+ const em::LoginScreenInputMethodsProto& login_screen_input_methods(
+ policy.login_screen_input_methods());
+ for (const auto& input_method :
+ login_screen_input_methods.login_screen_input_methods())
+ input_methods->AppendString(input_method);
+ policies->Set(key::kDeviceLoginScreenInputMethods, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD,
+ std::move(input_methods), nullptr);
+ }
}
void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy,
@@ -753,22 +803,6 @@ void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
}
}
- if (policy.has_login_screen_power_management()) {
- const em::LoginScreenPowerManagementProto& container(
- policy.login_screen_power_management());
- if (container.has_login_screen_power_management()) {
- std::unique_ptr<base::Value> decoded_json;
- decoded_json = DecodeJsonStringAndDropUnknownBySchema(
- container.login_screen_power_management(),
- key::kDeviceLoginScreenPowerManagement);
- if (decoded_json) {
- policies->Set(key::kDeviceLoginScreenPowerManagement,
- POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
- POLICY_SOURCE_CLOUD, std::move(decoded_json), nullptr);
- }
- }
- }
-
if (policy.has_system_settings()) {
const em::SystemSettingsProto& container(policy.system_settings());
if (container.has_block_devmode()) {
@@ -790,17 +824,6 @@ void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
}
}
- if (policy.has_login_screen_domain_auto_complete()) {
- const em::LoginScreenDomainAutoCompleteProto& container(
- policy.login_screen_domain_auto_complete());
- policies->Set(key::kDeviceLoginScreenDomainAutoComplete,
- POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>(
- container.login_screen_domain_auto_complete()),
- nullptr);
- }
-
if (policy.has_display_rotation_default()) {
const em::DisplayRotationDefaultProto& container(
policy.display_rotation_default());

Powered by Google App Engine
This is Rietveld 408576698