| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "components/policy/core/common/external_data_fetcher.h" | 18 #include "components/policy/core/common/external_data_fetcher.h" |
| 19 #include "components/policy/core/common/policy_types.h" | 19 #include "components/policy/core/common/policy_types.h" |
| 20 #include "components/policy/policy_export.h" | 20 #include "components/policy/policy_export.h" |
| 21 | 21 |
| 22 namespace policy { | 22 namespace policy { |
| 23 | 23 |
| 24 // A mapping of policy names to policy values for a given policy namespace. | 24 // A mapping of policy names to policy values for a given policy namespace. |
| 25 class POLICY_EXPORT PolicyMap { | 25 class POLICY_EXPORT PolicyMap { |
| 26 public: | 26 public: |
| 27 // Each policy maps to an Entry which keeps the policy value as well as other | 27 // Each policy maps to an Entry which keeps the policy value as well as other |
| 28 // relevant data about the policy. | 28 // relevant data about the policy. |
| 29 struct POLICY_EXPORT Entry { | 29 struct POLICY_EXPORT Entry { |
| 30 PolicyLevel level; | 30 PolicyLevel level = POLICY_LEVEL_RECOMMENDED; |
| 31 PolicyScope scope; | 31 PolicyScope scope = POLICY_SCOPE_USER; |
| 32 std::unique_ptr<base::Value> value; | 32 std::unique_ptr<base::Value> value; |
| 33 std::unique_ptr<ExternalDataFetcher> external_data_fetcher; | 33 std::unique_ptr<ExternalDataFetcher> external_data_fetcher; |
| 34 | 34 |
| 35 // For debugging and displaying only. Set by provider delivering the policy. | 35 // For debugging and displaying only. Set by provider delivering the policy. |
| 36 PolicySource source; | 36 PolicySource source = POLICY_SOURCE_ENTERPRISE_DEFAULT; |
| 37 | 37 |
| 38 Entry(); | 38 Entry(); |
| 39 ~Entry(); | 39 ~Entry(); |
| 40 | 40 |
| 41 Entry(Entry&&); | 41 Entry(Entry&&); |
| 42 Entry& operator=(Entry&&); | 42 Entry& operator=(Entry&&); |
| 43 | 43 |
| 44 // Returns a copy of |this|. | 44 // Returns a copy of |this|. |
| 45 Entry DeepCopy() const; | 45 Entry DeepCopy() const; |
| 46 | 46 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 bool deletion_value); | 137 bool deletion_value); |
| 138 | 138 |
| 139 PolicyMapType map_; | 139 PolicyMapType map_; |
| 140 | 140 |
| 141 DISALLOW_COPY_AND_ASSIGN(PolicyMap); | 141 DISALLOW_COPY_AND_ASSIGN(PolicyMap); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace policy | 144 } // namespace policy |
| 145 | 145 |
| 146 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ | 146 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
| OLD | NEW |