Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: components/policy/core/common/policy_namespace.h

Issue 50613003: Move the PolicyDomain and PolicyNamespace types to the policy component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/policy.gypi ('k') | components/policy/core/common/policy_namespace.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/policy.gypi ('k') | components/policy/core/common/policy_namespace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698