- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / admin_policy.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_
6 #define CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_
7
8 #include "base/values.h"
9 #include "chrome/common/extensions/extension.h"
10
11 namespace extensions {
12 class Extension;
13 }
14
15 // Functions for providing information about the extension whitelist,
16 // blacklist, and forcelist imposed by admin policy.
17 namespace extensions {
18 namespace admin_policy {
19
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.
22 // from the command line, or when loaded as an unpacked extension).
23 bool BlacklistedByDefault(const base::ListValue* blacklist);
24
25 // Returns true if the extension is allowed by the admin policy.
26 bool UserMayLoad(const base::ListValue* blacklist,
27                  const base::ListValue* whitelist,
28                  const base::DictionaryValue* forcelist,
29                  const base::ListValue* allowed_types,
30                  const Extension* extension,
31                  string16* error);
32
33 // Returns false if the extension is required to remain running. In practice
34 // this enforces the admin policy forcelist.
35 bool UserMayModifySettings(const Extension* extension, string16* error);
36
37 // Returns false if the extension is required to remain running. In practice
38 // this enforces the admin policy forcelist.
39 bool MustRemainEnabled(const Extension* extension, string16* error);
40
41 }  // namespace
42 }  // namespace
43
44 #endif  // CHROME_BROWSER_EXTENSIONS_ADMIN_POLICY_H_