| 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/policy/device_policy_decoder_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 if (policy.has_allow_bluetooth()) { | 319 if (policy.has_allow_bluetooth()) { |
| 320 const em::AllowBluetoothProto& container(policy.allow_bluetooth()); | 320 const em::AllowBluetoothProto& container(policy.allow_bluetooth()); |
| 321 if (container.has_allow_bluetooth()) { | 321 if (container.has_allow_bluetooth()) { |
| 322 policies->Set(key::kDeviceAllowBluetooth, POLICY_LEVEL_MANDATORY, | 322 policies->Set(key::kDeviceAllowBluetooth, POLICY_LEVEL_MANDATORY, |
| 323 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 323 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 324 new base::FundamentalValue(container.allow_bluetooth()), | 324 new base::FundamentalValue(container.allow_bluetooth()), |
| 325 nullptr); | 325 nullptr); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 |
| 329 if (policy.has_login_video_capture_allowed_urls()) { |
| 330 const em::LoginVideoCaptureAllowedUrlsProto& container( |
| 331 policy.login_video_capture_allowed_urls()); |
| 332 std::unique_ptr<base::ListValue> urls(new base::ListValue()); |
| 333 for (const auto& entry : container.urls()) { |
| 334 urls->Append(new base::StringValue(entry)); |
| 335 } |
| 336 policies->Set(key::kLoginVideoCaptureAllowedUrls, POLICY_LEVEL_MANDATORY, |
| 337 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, urls.release(), |
| 338 nullptr); |
| 339 } |
| 328 } | 340 } |
| 329 | 341 |
| 330 void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy, | 342 void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy, |
| 331 PolicyMap* policies) { | 343 PolicyMap* policies) { |
| 332 if (policy.has_data_roaming_enabled()) { | 344 if (policy.has_data_roaming_enabled()) { |
| 333 const em::DataRoamingEnabledProto& container(policy.data_roaming_enabled()); | 345 const em::DataRoamingEnabledProto& container(policy.data_roaming_enabled()); |
| 334 if (container.has_data_roaming_enabled()) { | 346 if (container.has_data_roaming_enabled()) { |
| 335 policies->Set(key::kDeviceDataRoamingEnabled, | 347 policies->Set(key::kDeviceDataRoamingEnabled, |
| 336 POLICY_LEVEL_MANDATORY, | 348 POLICY_LEVEL_MANDATORY, |
| 337 POLICY_SCOPE_MACHINE, | 349 POLICY_SCOPE_MACHINE, |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 // Decode the various groups of policies. | 934 // Decode the various groups of policies. |
| 923 DecodeLoginPolicies(policy, policies); | 935 DecodeLoginPolicies(policy, policies); |
| 924 DecodeNetworkPolicies(policy, policies); | 936 DecodeNetworkPolicies(policy, policies); |
| 925 DecodeReportingPolicies(policy, policies); | 937 DecodeReportingPolicies(policy, policies); |
| 926 DecodeAutoUpdatePolicies(policy, policies); | 938 DecodeAutoUpdatePolicies(policy, policies); |
| 927 DecodeAccessibilityPolicies(policy, policies); | 939 DecodeAccessibilityPolicies(policy, policies); |
| 928 DecodeGenericPolicies(policy, policies); | 940 DecodeGenericPolicies(policy, policies); |
| 929 } | 941 } |
| 930 | 942 |
| 931 } // namespace policy | 943 } // namespace policy |
| OLD | NEW |