OLD | NEW |
1 // Copyright (c) 2012 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_EXTENSIONS_ADMIN_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 class Extension; | 12 class Extension; |
13 } | 13 } |
14 | 14 |
15 // Functions for providing information about the extension whitelist, | 15 // Functions for providing information about the extension whitelist, |
16 // blacklist, and forcelist imposed by admin policy. | 16 // blacklist, and forcelist imposed by admin policy. |
17 namespace extensions { | 17 namespace extensions { |
18 namespace admin_policy { | 18 namespace admin_policy { |
19 | 19 |
20 // Checks if extensions are blacklisted by default, by policy. When true, this | 20 // Checks if extensions are blacklisted by default, by policy. When true, this |
21 // means that even extensions without an ID should be blacklisted (e.g. | 21 // means that even extensions without an ID should be blacklisted (e.g. |
22 // from the command line, or when loaded as an unpacked extension). | 22 // from the command line, or when loaded as an unpacked extension). |
23 bool BlacklistedByDefault(const base::ListValue* blacklist); | 23 bool BlacklistedByDefault(const base::ListValue* blacklist); |
24 | 24 |
25 // Returns true if the extension is allowed by Google blacklist and admin policy | 25 // Returns true if the extension is allowed by the admin policy. |
26 // white-, black- and forcelists. | 26 bool UserMayLoad(const base::ListValue* blacklist, |
27 bool UserMayLoad(bool is_google_blacklisted, | |
28 const base::ListValue* blacklist, | |
29 const base::ListValue* whitelist, | 27 const base::ListValue* whitelist, |
30 const base::ListValue* forcelist, | 28 const base::ListValue* forcelist, |
31 const Extension* extension, | 29 const Extension* extension, |
32 string16* error); | 30 string16* error); |
33 | 31 |
34 // Returns false if the extension is required to remain running. In practice | 32 // Returns false if the extension is required to remain running. In practice |
35 // this enforces the admin policy forcelist. | 33 // this enforces the admin policy forcelist. |
36 bool UserMayModifySettings(const Extension* extension, string16* error); | 34 bool UserMayModifySettings(const Extension* extension, string16* error); |
37 | 35 |
38 // Returns false if the extension is required to remain running. In practice | 36 // Returns false if the extension is required to remain running. In practice |
39 // this enforces the admin policy forcelist. | 37 // this enforces the admin policy forcelist. |
40 bool MustRemainEnabled(const Extension* extension, string16* error); | 38 bool MustRemainEnabled(const Extension* extension, string16* error); |
41 | 39 |
42 } // namespace | 40 } // namespace |
43 } // namespace | 41 } // namespace |
44 | 42 |
45 #endif // CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_ | 43 #endif // CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_ |
OLD | NEW |