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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_
10 namespace extensions
{
14 class ExtensionService
;
16 namespace extension_util
{
18 // Whether this extension can run in an incognito window.
19 bool IsIncognitoEnabled(const std::string
& extension_id
,
20 const ExtensionService
* service
);
22 // Will reload the extension since this permission is applied at loading time
24 void SetIsIncognitoEnabled(const std::string
& extension_id
,
25 ExtensionService
* service
,
28 // Returns true if the given extension can see events and data from another
29 // sub-profile (incognito to original profile, or vice versa).
30 bool CanCrossIncognito(const extensions::Extension
* extension
,
31 const ExtensionService
* service
);
33 // Returns true if the given extension can be loaded in incognito.
34 bool CanLoadInIncognito(const extensions::Extension
* extension
,
35 const ExtensionService
* service
);
37 // Whether this extension can inject scripts into pages with file URLs.
38 bool AllowFileAccess(const extensions::Extension
* extension
,
39 const ExtensionService
* service
);
41 // Will reload the extension since this permission is applied at loading time
43 void SetAllowFileAccess(const extensions::Extension
* extension
,
44 ExtensionService
* service
,
47 } // namespace extension_util
49 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_