OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/policy/policy_export.h" |
| 11 |
| 12 namespace policy { |
| 13 |
| 14 // Policies are namespaced by a (PolicyDomain, ID) pair. The meaning of the ID |
| 15 // string depends on the domain; for example, if the PolicyDomain is |
| 16 // "extensions" then the ID identifies the extension that the policies control. |
| 17 enum POLICY_EXPORT PolicyDomain { |
| 18 // The component ID for chrome policies is always the empty string. |
| 19 POLICY_DOMAIN_CHROME, |
| 20 |
| 21 // The extensions policy domain is a work in progress. Included here for |
| 22 // tests. |
| 23 POLICY_DOMAIN_EXTENSIONS, |
| 24 |
| 25 // Must be the last entry. |
| 26 POLICY_DOMAIN_SIZE, |
| 27 }; |
| 28 |
| 29 // Groups a policy domain and a component ID in a single object representing |
| 30 // a policy namespace. Objects of this class can be used as keys in std::maps. |
| 31 struct POLICY_EXPORT PolicyNamespace { |
| 32 public: |
| 33 PolicyNamespace(); |
| 34 PolicyNamespace(PolicyDomain domain, const std::string& component_id); |
| 35 PolicyNamespace(const PolicyNamespace& other); |
| 36 ~PolicyNamespace(); |
| 37 |
| 38 PolicyNamespace& operator=(const PolicyNamespace& other); |
| 39 bool operator<(const PolicyNamespace& other) const; |
| 40 bool operator==(const PolicyNamespace& other) const; |
| 41 bool operator!=(const PolicyNamespace& other) const; |
| 42 |
| 43 PolicyDomain domain; |
| 44 std::string component_id; |
| 45 }; |
| 46 |
| 47 } // namespace policy |
| 48 |
| 49 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ |
OLD | NEW |