OLD | NEW |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 kAttestationForContentProtectionEnabled, | 63 kAttestationForContentProtectionEnabled, |
64 kDeviceAttestationEnabled, | 64 kDeviceAttestationEnabled, |
65 kDeviceDisabled, | 65 kDeviceDisabled, |
66 kDeviceDisabledMessage, | 66 kDeviceDisabledMessage, |
67 kDeviceOwner, | 67 kDeviceOwner, |
68 kDeviceQuirksDownloadEnabled, | 68 kDeviceQuirksDownloadEnabled, |
69 kDisplayRotationDefault, | 69 kDisplayRotationDefault, |
70 kExtensionCacheSize, | 70 kExtensionCacheSize, |
71 kHeartbeatEnabled, | 71 kHeartbeatEnabled, |
72 kHeartbeatFrequency, | 72 kHeartbeatFrequency, |
| 73 kLoginApps, |
73 kLoginAuthenticationBehavior, | 74 kLoginAuthenticationBehavior, |
74 kLoginVideoCaptureAllowedUrls, | 75 kLoginVideoCaptureAllowedUrls, |
75 kPolicyMissingMitigationMode, | 76 kPolicyMissingMitigationMode, |
76 kRebootOnShutdown, | 77 kRebootOnShutdown, |
77 kReleaseChannel, | 78 kReleaseChannel, |
78 kReleaseChannelDelegated, | 79 kReleaseChannelDelegated, |
79 kReportDeviceActivityTimes, | 80 kReportDeviceActivityTimes, |
80 kReportDeviceBootMode, | 81 kReportDeviceBootMode, |
81 kReportDeviceHardwareStatus, | 82 kReportDeviceHardwareStatus, |
82 kReportDeviceLocation, | 83 kReportDeviceLocation, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (policy.has_login_video_capture_allowed_urls()) { | 277 if (policy.has_login_video_capture_allowed_urls()) { |
277 std::unique_ptr<base::ListValue> list(new base::ListValue()); | 278 std::unique_ptr<base::ListValue> list(new base::ListValue()); |
278 const em::LoginVideoCaptureAllowedUrlsProto& | 279 const em::LoginVideoCaptureAllowedUrlsProto& |
279 login_video_capture_allowed_urls_proto = | 280 login_video_capture_allowed_urls_proto = |
280 policy.login_video_capture_allowed_urls(); | 281 policy.login_video_capture_allowed_urls(); |
281 for (const auto& value : login_video_capture_allowed_urls_proto.urls()) { | 282 for (const auto& value : login_video_capture_allowed_urls_proto.urls()) { |
282 list->Append(new base::StringValue(value)); | 283 list->Append(new base::StringValue(value)); |
283 } | 284 } |
284 new_values_cache->SetValue(kLoginVideoCaptureAllowedUrls, std::move(list)); | 285 new_values_cache->SetValue(kLoginVideoCaptureAllowedUrls, std::move(list)); |
285 } | 286 } |
| 287 |
| 288 if (policy.has_login_apps()) { |
| 289 std::unique_ptr<base::ListValue> login_apps(new base::ListValue); |
| 290 const em::LoginAppsProto& login_apps_proto(policy.login_apps()); |
| 291 for (const auto& login_app : login_apps_proto.login_apps()) |
| 292 login_apps->Append(new base::StringValue(login_app)); |
| 293 new_values_cache->SetValue(kLoginApps, std::move(login_apps)); |
| 294 } |
286 } | 295 } |
287 | 296 |
288 void DecodeNetworkPolicies( | 297 void DecodeNetworkPolicies( |
289 const em::ChromeDeviceSettingsProto& policy, | 298 const em::ChromeDeviceSettingsProto& policy, |
290 PrefValueMap* new_values_cache) { | 299 PrefValueMap* new_values_cache) { |
291 // kSignedDataRoamingEnabled has a default value of false. | 300 // kSignedDataRoamingEnabled has a default value of false. |
292 new_values_cache->SetBoolean( | 301 new_values_cache->SetBoolean( |
293 kSignedDataRoamingEnabled, | 302 kSignedDataRoamingEnabled, |
294 policy.has_data_roaming_enabled() && | 303 policy.has_data_roaming_enabled() && |
295 policy.data_roaming_enabled().has_data_roaming_enabled() && | 304 policy.data_roaming_enabled().has_data_roaming_enabled() && |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 // Notify the observers we are done. | 837 // Notify the observers we are done. |
829 std::vector<base::Closure> callbacks; | 838 std::vector<base::Closure> callbacks; |
830 callbacks.swap(callbacks_); | 839 callbacks.swap(callbacks_); |
831 for (size_t i = 0; i < callbacks.size(); ++i) | 840 for (size_t i = 0; i < callbacks.size(); ++i) |
832 callbacks[i].Run(); | 841 callbacks[i].Run(); |
833 | 842 |
834 return settings_loaded; | 843 return settings_loaded; |
835 } | 844 } |
836 | 845 |
837 } // namespace chromeos | 846 } // namespace chromeos |
OLD | NEW |