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_
14 namespace extensions
{
20 // Returns true if |extension_id| can run in an incognito window.
21 bool IsIncognitoEnabled(const std::string
& extension_id
,
22 content::BrowserContext
* context
);
24 // Sets whether |extension_id| can run in an incognito window. Reloads the
25 // extension if it's enabled since this permission is applied at loading time
26 // only. Note that an ExtensionService must exist.
27 void SetIsIncognitoEnabled(const std::string
& extension_id
,
28 content::BrowserContext
* context
,
31 // Returns true if |extension| can see events and data from another sub-profile
32 // (incognito to original profile, or vice versa).
33 bool CanCrossIncognito(const extensions::Extension
* extension
,
34 content::BrowserContext
* context
);
36 // Returns true if |extension| can be loaded in incognito.
37 bool CanLoadInIncognito(const extensions::Extension
* extension
,
38 content::BrowserContext
* context
);
40 // Returns true if this extension can inject scripts into pages with file URLs.
41 bool AllowFileAccess(const std::string
& extension_id
,
42 content::BrowserContext
* context
);
44 // Sets whether |extension_id| can inject scripts into pages with file URLs.
45 // Reloads the extension if it's enabled since this permission is applied at
46 // loading time only. Note than an ExtensionService must exist.
47 void SetAllowFileAccess(const std::string
& extension_id
,
48 content::BrowserContext
* context
,
51 // Returns true if |extension_id| can be launched (possibly only after being
53 bool IsAppLaunchable(const std::string
& extension_id
,
54 content::BrowserContext
* context
);
56 // Returns true if |extension_id| can be launched without being enabled first.
57 bool IsAppLaunchableWithoutEnabling(const std::string
& extension_id
,
58 content::BrowserContext
* context
);
60 // Returns true if |extension_id| is idle and it is safe to perform actions such
62 bool IsExtensionIdle(const std::string
& extension_id
,
63 content::BrowserContext
* context
);
65 // Returns true if |extension_id| is installed permanently and not ephemerally.
66 bool IsExtensionInstalledPermanently(const std::string
& extension_id
,
67 content::BrowserContext
* context
);
70 } // namespace extensions
72 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_