blob: fb9d74e4cd2bc401e65c79ae1034c24b8ca24455 [file] [log] [blame]
[email protected]a7ff4b72013-10-17 20:56:021// 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_
6#define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_
7
8#include <string>
9
10namespace extensions {
11class Extension;
12}
13
14class ExtensionService;
15
16namespace extension_util {
17
18// Whether this extension can run in an incognito window.
19bool IsIncognitoEnabled(const std::string& extension_id,
20 const ExtensionService* service);
21
22// Will reload the extension since this permission is applied at loading time
23// only.
24void SetIsIncognitoEnabled(const std::string& extension_id,
25 ExtensionService* service,
26 bool enabled);
27
28// Returns true if the given extension can see events and data from another
29// sub-profile (incognito to original profile, or vice versa).
30bool CanCrossIncognito(const extensions::Extension* extension,
31 const ExtensionService* service);
32
33// Returns true if the given extension can be loaded in incognito.
34bool CanLoadInIncognito(const extensions::Extension* extension,
35 const ExtensionService* service);
36
37// Whether this extension can inject scripts into pages with file URLs.
38bool AllowFileAccess(const extensions::Extension* extension,
39 const ExtensionService* service);
40
41// Will reload the extension since this permission is applied at loading time
42// only.
43void SetAllowFileAccess(const extensions::Extension* extension,
44 ExtensionService* service,
45 bool allow);
46
47} // namespace extension_util
48
49#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_