| 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 // Flags |extension_id| as "installed by a custodian". |
| 73 // This is relevant for supervised users and is used to limit their privileges |
| 74 // for extensions installed by their custodian (e.g. they cannot uninstall them) |
| 75 void SetWasInstalledByCustodian(const std::string& extension_id, |
| 76 content::BrowserContext* context); |
| 77 |
| 66 // Returns true if the extension with |extension_id| is allowed to execute | 78 // Returns true if the extension with |extension_id| is allowed to execute |
| 67 // scripts on all urls (exempting chrome:// urls, etc) without explicit | 79 // scripts on all urls (exempting chrome:// urls, etc) without explicit |
| 68 // user consent. | 80 // user consent. |
| 69 // This should only be used with FeatureSwitch::scripts_require_action() | 81 // This should only be used with FeatureSwitch::scripts_require_action() |
| 70 // enabled. | 82 // enabled. |
| 71 bool AllowedScriptingOnAllUrls(const std::string& extension_id, | 83 bool AllowedScriptingOnAllUrls(const std::string& extension_id, |
| 72 content::BrowserContext* context); | 84 content::BrowserContext* context); |
| 73 | 85 |
| 74 // Returns the default value for being allowed to script on all urls. | 86 // Returns the default value for being allowed to script on all urls. |
| 75 bool DefaultAllowedScriptingOnAllUrls(); | 87 bool DefaultAllowedScriptingOnAllUrls(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // | 136 // |
| 125 // TODO(benwells): http://crbug.com/441128: Remove this entirely once the | 137 // TODO(benwells): http://crbug.com/441128: Remove this entirely once the |
| 126 // feature is stable. | 138 // feature is stable. |
| 127 bool IsNewBookmarkAppsEnabled(); | 139 bool IsNewBookmarkAppsEnabled(); |
| 128 | 140 |
| 129 // TODO(dominickn): http://crbug.com/517682: Remove this entirely once | 141 // TODO(dominickn): http://crbug.com/517682: Remove this entirely once |
| 130 // open in window is stable on Mac. | 142 // open in window is stable on Mac. |
| 131 bool CanHostedAppsOpenInWindows(); | 143 bool CanHostedAppsOpenInWindows(); |
| 132 | 144 |
| 133 // Returns true for custodian-installed extensions in a supervised profile. | 145 // Returns true for custodian-installed extensions in a supervised profile. |
| 134 bool IsExtensionSupervised(const Extension* extension, const Profile* profile); | 146 bool IsExtensionSupervised(const Extension* extension, Profile* profile); |
| 135 | 147 |
| 136 // Returns true if supervised users need approval from their custodian for | 148 // Returns true if supervised users need approval from their custodian for |
| 137 // approving escalated permissions on updated extensions. | 149 // approving escalated permissions on updated extensions. |
| 138 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile); | 150 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile); |
| 139 | 151 |
| 140 } // namespace util | 152 } // namespace util |
| 141 } // namespace extensions | 153 } // namespace extensions |
| 142 | 154 |
| 143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 155 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
| OLD | NEW |