| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "components/policy/core/common/cloud/component_cloud_policy_store.h" | 5 #include "components/policy/core/common/cloud/component_cloud_policy_store.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 12 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 13 #include "components/policy/core/common/cloud/cloud_policy_validator.h" | 13 #include "components/policy/core/common/cloud/cloud_policy_validator.h" |
| 14 #include "components/policy/core/common/external_data_fetcher.h" | 14 #include "components/policy/core/common/external_data_fetcher.h" |
| 15 #include "components/policy/core/common/policy_map.h" | 15 #include "components/policy/core/common/policy_map.h" |
| 16 #include "components/policy/core/common/policy_types.h" |
| 16 #include "crypto/sha2.h" | 17 #include "crypto/sha2.h" |
| 17 #include "policy/proto/chrome_extension_policy.pb.h" | 18 #include "policy/proto/chrome_extension_policy.pb.h" |
| 18 #include "policy/proto/device_management_backend.pb.h" | 19 #include "policy/proto/device_management_backend.pb.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 20 | 21 |
| 21 namespace em = enterprise_management; | 22 namespace em = enterprise_management; |
| 22 | 23 |
| 23 namespace policy { | 24 namespace policy { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 PolicyLevel level = POLICY_LEVEL_MANDATORY; | 347 PolicyLevel level = POLICY_LEVEL_MANDATORY; |
| 347 std::string level_string; | 348 std::string level_string; |
| 348 if (description->GetStringWithoutPathExpansion(kLevel, &level_string) && | 349 if (description->GetStringWithoutPathExpansion(kLevel, &level_string) && |
| 349 level_string == kRecommended) { | 350 level_string == kRecommended) { |
| 350 level = POLICY_LEVEL_RECOMMENDED; | 351 level = POLICY_LEVEL_RECOMMENDED; |
| 351 } | 352 } |
| 352 | 353 |
| 353 // If policy for components is ever used for device-level settings then | 354 // If policy for components is ever used for device-level settings then |
| 354 // this must support a configurable scope; assuming POLICY_SCOPE_USER is | 355 // this must support a configurable scope; assuming POLICY_SCOPE_USER is |
| 355 // fine for now. | 356 // fine for now. |
| 356 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL); | 357 policy->Set(it.key(), level, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
| 358 value.release(), nullptr); |
| 357 } | 359 } |
| 358 | 360 |
| 359 return true; | 361 return true; |
| 360 } | 362 } |
| 361 | 363 |
| 362 } // namespace policy | 364 } // namespace policy |
| OLD | NEW |