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