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

Side by Side Diff: chrome/browser/policy/policy_status_info.h

Issue 9111022: Removed ConfigurationPolicyType and extended PolicyMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 11 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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_STATUS_INFO_H_ 5 #ifndef CHROME_BROWSER_POLICY_POLICY_STATUS_INFO_H_
6 #define CHROME_BROWSER_POLICY_POLICY_STATUS_INFO_H_ 6 #define CHROME_BROWSER_POLICY_POLICY_STATUS_INFO_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/policy/policy_map.h"
12 13
13 namespace policy { 14 namespace policy {
14 15
15 // Describes a policy's status on the client. 16 // Describes a policy's status on the client.
16 struct PolicyStatusInfo { 17 struct PolicyStatusInfo {
17 18
18 // Defines the possible sources a policy can have.
19 enum PolicySourceType {
20 USER,
21 DEVICE,
22 SOURCE_TYPE_UNDEFINED,
23 };
24
25 // Defines the possible levels a policy can be operating on.
26 enum PolicyLevel {
27 MANDATORY,
28 RECOMMENDED,
29 LEVEL_UNDEFINED,
30 };
31
32 // Defines the possible statuses a policy can have. 19 // Defines the possible statuses a policy can have.
33 enum PolicyStatus { 20 enum PolicyStatus {
34 ENFORCED, 21 ENFORCED,
35 FAILED, 22 FAILED,
36 STATUS_UNDEFINED, 23 STATUS_UNDEFINED,
37 }; 24 };
38 25
39 PolicyStatusInfo(); 26 PolicyStatusInfo();
40 PolicyStatusInfo(const string16& name, 27 PolicyStatusInfo(const string16& name,
41 PolicySourceType source_type, 28 PolicyScope scope,
42 PolicyLevel level, 29 PolicyLevel level,
43 Value* value, 30 Value* value,
44 PolicyStatus status, 31 PolicyStatus status,
45 const string16& error_message); 32 const string16& error_message);
46 ~PolicyStatusInfo(); 33 ~PolicyStatusInfo();
47 34
48 // Returns a DictionaryValue pointer containing the information in the object 35 // Returns a DictionaryValue pointer containing the information in the object
49 // for UI purposes. The caller acquires ownership of the returned value. 36 // for UI purposes. The caller acquires ownership of the returned value.
50 DictionaryValue* GetDictionaryValue() const; 37 DictionaryValue* GetDictionaryValue() const;
51 38
52 // Returns true if this PolicyStatusInfo object and |other_info| have equal 39 // Returns true if this PolicyStatusInfo object and |other_info| have equal
53 // contents and false otherwise. 40 // contents and false otherwise.
54 bool Equals(const PolicyStatusInfo* other_info) const; 41 bool Equals(const PolicyStatusInfo* other_info) const;
55 42
56 // Returns the string corresponding to the PolicySourceType enum value 43 // Returns the string corresponding to the PolicyScope enum value |scope|.
57 // |source_type|. 44 static string16 GetPolicyScopeString(PolicyScope scope);
58 static string16 GetSourceTypeString(PolicySourceType source_type);
59 45
60 // Returns the string corresponding to the PolicyLevel enum value |level|. 46 // Returns the string corresponding to the PolicyLevel enum value |level|.
61 static string16 GetPolicyLevelString(PolicyLevel level); 47 static string16 GetPolicyLevelString(PolicyLevel level);
62 48
63 // The name of the policy. 49 // The name of the policy.
64 string16 name; 50 string16 name;
65 51
66 // The source type of the policy (user, device or undefined). 52 // The scope of the policy (user or device).
67 PolicySourceType source_type; 53 PolicyScope scope;
68 54
69 // The level of the policy (mandatory, recommended or undefined). 55 // The level of the policy (mandatory or recommended).
70 PolicyLevel level; 56 PolicyLevel level;
71 57
72 // The policy value. 58 // The policy value.
73 scoped_ptr<Value> value; 59 scoped_ptr<Value> value;
74 60
75 // The policy status (details whether the policy was successfully enforced). 61 // The policy status (details whether the policy was successfully enforced).
76 PolicyStatus status; 62 PolicyStatus status;
77 63
78 // An error message in cases where the policy could not be enforced. 64 // An error message in cases where the policy could not be enforced.
79 string16 error_message; 65 string16 error_message;
80 66
81 // Paths for the DictionaryValue returned by GetDictionaryValue(). 67 // Paths for the DictionaryValue returned by GetDictionaryValue().
82 static const char kLevelDictPath[]; 68 static const char kLevelDictPath[];
83 static const char kNameDictPath[]; 69 static const char kNameDictPath[];
70 static const char kScopeDictPath[];
84 static const char kSetDictPath[]; 71 static const char kSetDictPath[];
85 static const char kSourceTypeDictPath[];
86 static const char kStatusDictPath[]; 72 static const char kStatusDictPath[];
87 static const char kValueDictPath[]; 73 static const char kValueDictPath[];
88 74
89 DISALLOW_COPY_AND_ASSIGN(PolicyStatusInfo); 75 DISALLOW_COPY_AND_ASSIGN(PolicyStatusInfo);
90 }; 76 };
91 77
92 } // namespace policy 78 } // namespace policy
93 79
94 #endif // CHROME_BROWSER_POLICY_POLICY_STATUS_INFO_H_ 80 #endif // CHROME_BROWSER_POLICY_POLICY_STATUS_INFO_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_map_unittest.cc ('k') | chrome/browser/policy/policy_status_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698