| 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 #ifndef CHROME_BROWSER_POLICY_POLICY_MAP_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
| 6 #define CHROME_BROWSER_POLICY_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> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/policy/external_data_fetcher.h" | 14 #include "components/policy/core/common/external_data_fetcher.h" |
| 15 #include "chrome/browser/policy/policy_types.h" | 15 #include "components/policy/core/common/policy_types.h" |
| 16 #include "components/policy/policy_export.h" |
| 16 | 17 |
| 17 namespace policy { | 18 namespace policy { |
| 18 | 19 |
| 19 // A mapping of policy names to policy values for a given policy namespace. | 20 // A mapping of policy names to policy values for a given policy namespace. |
| 20 class PolicyMap { | 21 class POLICY_EXPORT PolicyMap { |
| 21 public: | 22 public: |
| 22 // 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 |
| 23 // relevant data about the policy. | 24 // relevant data about the policy. |
| 24 struct Entry { | 25 struct POLICY_EXPORT Entry { |
| 25 PolicyLevel level; | 26 PolicyLevel level; |
| 26 PolicyScope scope; | 27 PolicyScope scope; |
| 27 base::Value* value; | 28 base::Value* value; |
| 28 ExternalDataFetcher* external_data_fetcher; | 29 ExternalDataFetcher* external_data_fetcher; |
| 29 | 30 |
| 30 Entry() | 31 Entry() |
| 31 : level(POLICY_LEVEL_RECOMMENDED), | 32 : level(POLICY_LEVEL_RECOMMENDED), |
| 32 scope(POLICY_SCOPE_USER), | 33 scope(POLICY_SCOPE_USER), |
| 33 value(NULL), | 34 value(NULL), |
| 34 external_data_fetcher(NULL) {} | 35 external_data_fetcher(NULL) {} |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 static bool MapEntryEquals(const PolicyMapType::value_type& a, | 115 static bool MapEntryEquals(const PolicyMapType::value_type& a, |
| 115 const PolicyMapType::value_type& b); | 116 const PolicyMapType::value_type& b); |
| 116 | 117 |
| 117 PolicyMapType map_; | 118 PolicyMapType map_; |
| 118 | 119 |
| 119 DISALLOW_COPY_AND_ASSIGN(PolicyMap); | 120 DISALLOW_COPY_AND_ASSIGN(PolicyMap); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace policy | 123 } // namespace policy |
| 123 | 124 |
| 124 #endif // CHROME_BROWSER_POLICY_POLICY_MAP_H_ | 125 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MAP_H_ |
| OLD | NEW |