| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool AllowFileAccess(const std::string& extension_id, | 56 bool AllowFileAccess(const std::string& extension_id, |
| 57 content::BrowserContext* context); | 57 content::BrowserContext* context); |
| 58 | 58 |
| 59 // Sets whether |extension_id| can inject scripts into pages with file URLs. | 59 // Sets whether |extension_id| can inject scripts into pages with file URLs. |
| 60 // Reloads the extension if it's enabled since this permission is applied at | 60 // Reloads the extension if it's enabled since this permission is applied at |
| 61 // loading time only. Note than an ExtensionService must exist. | 61 // loading time only. Note than an ExtensionService must exist. |
| 62 void SetAllowFileAccess(const std::string& extension_id, | 62 void SetAllowFileAccess(const std::string& extension_id, |
| 63 content::BrowserContext* context, | 63 content::BrowserContext* context, |
| 64 bool allow); | 64 bool allow); |
| 65 | 65 |
| 66 // Returns true if this extension has been installed by the custodian of |
| 67 // a supervised user. It is relevant for supervised users and used to block |
| 68 // them from uninstalling the extension for example. |
| 69 bool WasInstalledByCustodian(const std::string& extension_id, |
| 70 content::BrowserContext* context); |
| 71 |
| 72 // Sets whether |extension_id| is installed by a custodian. |
| 73 // This is relevant for supervised users and is used to limit their privileges |
| 74 // for extensions installed by their custodians (e.g. supervised users cannot |
| 75 // uninstall such extensions). |
| 76 void SetWasInstalledByCustodian(const std::string& extension_id, |
| 77 content::BrowserContext* context, |
| 78 bool installed_by_custodian); |
| 79 |
| 66 // Returns true if the extension with |extension_id| is allowed to execute | 80 // Returns true if the extension with |extension_id| is allowed to execute |
| 67 // scripts on all urls (exempting chrome:// urls, etc) without explicit | 81 // scripts on all urls (exempting chrome:// urls, etc) without explicit |
| 68 // user consent. | 82 // user consent. |
| 69 // This should only be used with FeatureSwitch::scripts_require_action() | 83 // This should only be used with FeatureSwitch::scripts_require_action() |
| 70 // enabled. | 84 // enabled. |
| 71 bool AllowedScriptingOnAllUrls(const std::string& extension_id, | 85 bool AllowedScriptingOnAllUrls(const std::string& extension_id, |
| 72 content::BrowserContext* context); | 86 content::BrowserContext* context); |
| 73 | 87 |
| 74 // Returns the default value for being allowed to script on all urls. | 88 // Returns the default value for being allowed to script on all urls. |
| 75 bool DefaultAllowedScriptingOnAllUrls(); | 89 bool DefaultAllowedScriptingOnAllUrls(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // | 138 // |
| 125 // TODO(benwells): http://crbug.com/441128: Remove this entirely once the | 139 // TODO(benwells): http://crbug.com/441128: Remove this entirely once the |
| 126 // feature is stable. | 140 // feature is stable. |
| 127 bool IsNewBookmarkAppsEnabled(); | 141 bool IsNewBookmarkAppsEnabled(); |
| 128 | 142 |
| 129 // TODO(dominickn): http://crbug.com/517682: Remove this entirely once | 143 // TODO(dominickn): http://crbug.com/517682: Remove this entirely once |
| 130 // open in window is stable on Mac. | 144 // open in window is stable on Mac. |
| 131 bool CanHostedAppsOpenInWindows(); | 145 bool CanHostedAppsOpenInWindows(); |
| 132 | 146 |
| 133 // Returns true for custodian-installed extensions in a supervised profile. | 147 // Returns true for custodian-installed extensions in a supervised profile. |
| 134 bool IsExtensionSupervised(const Extension* extension, const Profile* profile); | 148 bool IsExtensionSupervised(const Extension* extension, Profile* profile); |
| 135 | 149 |
| 136 // Returns true if supervised users need approval from their custodian for | 150 // Returns true if supervised users need approval from their custodian for |
| 137 // approving escalated permissions on updated extensions. | 151 // approving escalated permissions on updated extensions. |
| 138 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile); | 152 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile); |
| 139 | 153 |
| 140 } // namespace util | 154 } // namespace util |
| 141 } // namespace extensions | 155 } // namespace extensions |
| 142 | 156 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 157 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
| OLD | NEW |