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_DETAILS_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_DETAILS_H_
7 
8 #include <stddef.h>
9 
10 #include <string>
11 
12 #include "base/callback_forward.h"
13 #include "components/policy/policy_export.h"
14 #include "components/policy/risk_tag.h"
15 
16 namespace policy {
17 
18 // Contains read-only metadata about a Chrome policy.
19 struct POLICY_EXPORT PolicyDetails {
20   // True if this policy has been deprecated.
21   bool is_deprecated;
22 
23   // True if this policy is a Chrome OS device policy.
24   bool is_device_policy;
25 
26   // The id of the protobuf field that contains this policy,
27   // in the cloud policy protobuf.
28   int id;
29 
30   // If this policy references external data then this is the maximum size
31   // allowed for that data.
32   // Otherwise this field is 0 and doesn't have any meaning.
33   size_t max_external_data_size;
34 
35   // Contains tags that describe impact on a user's privacy or security.
36   RiskTag risk_tags[kMaxRiskTagCount];
37 };
38 
39 // A typedef for functions that match the signature of
40 // GetChromePolicyDetails(). This can be used to inject that
41 // function into objects, so that it can be easily mocked for
42 // tests.
43 typedef base::Callback<const PolicyDetails*(const std::string&)>
44     GetChromePolicyDetailsCallback;
45 
46 }  // namespace policy
47 
48 #endif  // COMPONENTS_POLICY_CORE_COMMON_POLICY_DETAILS_H_
49