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