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

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_provider.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 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/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include <memory.h> 7 #include <memory.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 kServiceAccountIdentity, 91 kServiceAccountIdentity,
92 kSignedDataRoamingEnabled, 92 kSignedDataRoamingEnabled,
93 kStartUpFlags, 93 kStartUpFlags,
94 kStatsReportingPref, 94 kStatsReportingPref,
95 kSystemLogUploadEnabled, 95 kSystemLogUploadEnabled,
96 kSystemTimezonePolicy, 96 kSystemTimezonePolicy,
97 kSystemUse24HourClock, 97 kSystemUse24HourClock,
98 kTargetVersionPrefix, 98 kTargetVersionPrefix,
99 kUpdateDisabled, 99 kUpdateDisabled,
100 kVariationsRestrictParameter, 100 kVariationsRestrictParameter,
101 kDeviceLoginScreenLocales,
102 kDeviceLoginScreenInputMethods,
101 }; 103 };
102 104
103 void DecodeLoginPolicies( 105 void DecodeLoginPolicies(
104 const em::ChromeDeviceSettingsProto& policy, 106 const em::ChromeDeviceSettingsProto& policy,
105 PrefValueMap* new_values_cache) { 107 PrefValueMap* new_values_cache) {
106 // For all our boolean settings the following is applicable: 108 // For all our boolean settings the following is applicable:
107 // true is default permissive value and false is safe prohibitive value. 109 // true is default permissive value and false is safe prohibitive value.
108 // Exceptions: 110 // Exceptions:
109 // kAccountsPrefEphemeralUsersEnabled has a default value of false. 111 // kAccountsPrefEphemeralUsersEnabled has a default value of false.
110 // kAccountsPrefSupervisedUsersEnabled has a default value of false 112 // kAccountsPrefSupervisedUsersEnabled has a default value of false
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 new_values_cache->SetValue(kLoginVideoCaptureAllowedUrls, std::move(list)); 305 new_values_cache->SetValue(kLoginVideoCaptureAllowedUrls, std::move(list));
304 } 306 }
305 307
306 if (policy.has_login_apps()) { 308 if (policy.has_login_apps()) {
307 std::unique_ptr<base::ListValue> login_apps(new base::ListValue); 309 std::unique_ptr<base::ListValue> login_apps(new base::ListValue);
308 const em::LoginAppsProto& login_apps_proto(policy.login_apps()); 310 const em::LoginAppsProto& login_apps_proto(policy.login_apps());
309 for (const auto& login_app : login_apps_proto.login_apps()) 311 for (const auto& login_app : login_apps_proto.login_apps())
310 login_apps->AppendString(login_app); 312 login_apps->AppendString(login_app);
311 new_values_cache->SetValue(kLoginApps, std::move(login_apps)); 313 new_values_cache->SetValue(kLoginApps, std::move(login_apps));
312 } 314 }
315
316 if (policy.has_login_screen_locales()) {
317 std::unique_ptr<base::ListValue> locales(new base::ListValue);
318 const em::LoginScreenLocalesProto& login_screen_locales(
319 policy.login_screen_locales());
320 for (const auto& locale : login_screen_locales.login_screen_locales())
321 locales->AppendString(locale);
322 new_values_cache->SetValue(kDeviceLoginScreenLocales, std::move(locales));
323 }
324
325 if (policy.has_login_screen_input_methods()) {
326 std::unique_ptr<base::ListValue> input_methods(new base::ListValue);
327 const em::LoginScreenInputMethodsProto& login_screen_input_methods(
328 policy.login_screen_input_methods());
329 for (const auto& input_method :
330 login_screen_input_methods.login_screen_input_methods())
331 input_methods->AppendString(input_method);
332 new_values_cache->SetValue(kDeviceLoginScreenInputMethods,
333 std::move(input_methods));
334 }
313 } 335 }
314 336
315 void DecodeNetworkPolicies( 337 void DecodeNetworkPolicies(
316 const em::ChromeDeviceSettingsProto& policy, 338 const em::ChromeDeviceSettingsProto& policy,
317 PrefValueMap* new_values_cache) { 339 PrefValueMap* new_values_cache) {
318 // kSignedDataRoamingEnabled has a default value of false. 340 // kSignedDataRoamingEnabled has a default value of false.
319 new_values_cache->SetBoolean( 341 new_values_cache->SetBoolean(
320 kSignedDataRoamingEnabled, 342 kSignedDataRoamingEnabled,
321 policy.has_data_roaming_enabled() && 343 policy.has_data_roaming_enabled() &&
322 policy.data_roaming_enabled().has_data_roaming_enabled() && 344 policy.data_roaming_enabled().has_data_roaming_enabled() &&
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 // Notify the observers we are done. 893 // Notify the observers we are done.
872 std::vector<base::Closure> callbacks; 894 std::vector<base::Closure> callbacks;
873 callbacks.swap(callbacks_); 895 callbacks.swap(callbacks_);
874 for (size_t i = 0; i < callbacks.size(); ++i) 896 for (size_t i = 0; i < callbacks.size(); ++i)
875 callbacks[i].Run(); 897 callbacks[i].Run();
876 898
877 return settings_loaded; 899 return settings_loaded;
878 } 900 }
879 901
880 } // namespace chromeos 902 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698