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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class POLICY_EXPORT PolicyMap { | 21 class POLICY_EXPORT PolicyMap { |
22 public: | 22 public: |
23 // Each policy maps to an Entry which keeps the policy value as well as other | 23 // Each policy maps to an Entry which keeps the policy value as well as other |
24 // relevant data about the policy. | 24 // relevant data about the policy. |
25 struct POLICY_EXPORT Entry { | 25 struct POLICY_EXPORT Entry { |
26 PolicyLevel level; | 26 PolicyLevel level; |
27 PolicyScope scope; | 27 PolicyScope scope; |
28 base::Value* value; | 28 base::Value* value; |
29 ExternalDataFetcher* external_data_fetcher; | 29 ExternalDataFetcher* external_data_fetcher; |
30 | 30 |
31 Entry() | 31 Entry(); |
32 : level(POLICY_LEVEL_RECOMMENDED), | |
33 scope(POLICY_SCOPE_USER), | |
34 value(NULL), | |
35 external_data_fetcher(NULL) {} | |
36 | 32 |
37 // Deletes all members owned by |this|. | 33 // Deletes all members owned by |this|. |
38 void DeleteOwnedMembers(); | 34 void DeleteOwnedMembers(); |
39 | 35 |
40 // Returns a copy of |this|. | 36 // Returns a copy of |this|. |
41 scoped_ptr<Entry> DeepCopy() const; | 37 scoped_ptr<Entry> DeepCopy() const; |
42 | 38 |
43 // Returns true if |this| has higher priority than |other|. | 39 // Returns true if |this| has higher priority than |other|. |
44 bool has_higher_priority_than(const Entry& other) const; | 40 bool has_higher_priority_than(const Entry& other) const; |
45 | 41 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const PolicyMapType::value_type& b); | 118 const PolicyMapType::value_type& b); |
123 | 119 |
124 PolicyMapType map_; | 120 PolicyMapType map_; |
125 | 121 |
126 DISALLOW_COPY_AND_ASSIGN(PolicyMap); | 122 DISALLOW_COPY_AND_ASSIGN(PolicyMap); |
127 }; | 123 }; |
128 | 124 |
129 } // namespace policy | 125 } // namespace policy |
130 | 126 |
131 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ | 127 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
OLD | NEW |