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.
5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_
11 #include "components/policy/policy_export.h"
15 // Policies are namespaced by a (PolicyDomain, ID) pair. The meaning of the ID
16 // string depends on the domain; for example, if the PolicyDomain is
17 // "extensions" then the ID identifies the extension that the policies control.
18 enum POLICY_EXPORT PolicyDomain
{
19 // The component ID for chrome policies is always the empty string.
22 // The extensions policy domain is a work in progress. Included here for
24 POLICY_DOMAIN_EXTENSIONS
,
26 // Must be the last entry.
30 // Groups a policy domain and a component ID in a single object representing
31 // a policy namespace. Objects of this class can be used as keys in std::maps.
32 struct POLICY_EXPORT PolicyNamespace
{
35 PolicyNamespace(PolicyDomain domain
, const std::string
& component_id
);
36 PolicyNamespace(const PolicyNamespace
& other
);
39 PolicyNamespace
& operator=(const PolicyNamespace
& other
);
40 bool operator<(const PolicyNamespace
& other
) const;
41 bool operator==(const PolicyNamespace
& other
) const;
42 bool operator!=(const PolicyNamespace
& other
) const;
45 std::string component_id
;
48 typedef std::vector
<PolicyNamespace
> PolicyNamespaceList
;
52 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_