Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/extensions/extension_util.h

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to code review by treib@ Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Sets whether |extension_id| is installed by a custodian.
67 // This is relevant for supervised users and is used to limit their privileges
68 // for extensions installed by their custodian (e.g. they cannot uninstall them)
69 void SetWasInstalledByCustodian(const std::string& extension_id,
70 content::BrowserContext* context,
71 bool installed_by_custodian);
72
66 // Returns true if the extension with |extension_id| is allowed to execute 73 // Returns true if the extension with |extension_id| is allowed to execute
67 // scripts on all urls (exempting chrome:// urls, etc) without explicit 74 // scripts on all urls (exempting chrome:// urls, etc) without explicit
68 // user consent. 75 // user consent.
69 // This should only be used with FeatureSwitch::scripts_require_action() 76 // This should only be used with FeatureSwitch::scripts_require_action()
70 // enabled. 77 // enabled.
71 bool AllowedScriptingOnAllUrls(const std::string& extension_id, 78 bool AllowedScriptingOnAllUrls(const std::string& extension_id,
72 content::BrowserContext* context); 79 content::BrowserContext* context);
73 80
74 // Returns the default value for being allowed to script on all urls. 81 // Returns the default value for being allowed to script on all urls.
75 bool DefaultAllowedScriptingOnAllUrls(); 82 bool DefaultAllowedScriptingOnAllUrls();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool IsExtensionSupervised(const Extension* extension, const Profile* profile); 141 bool IsExtensionSupervised(const Extension* extension, const Profile* profile);
135 142
136 // Returns true if supervised users need approval from their custodian for 143 // Returns true if supervised users need approval from their custodian for
137 // approving escalated permissions on updated extensions. 144 // approving escalated permissions on updated extensions.
138 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile); 145 bool NeedCustodianApprovalForPermissionIncrease(const Profile* profile);
139 146
140 } // namespace util 147 } // namespace util
141 } // namespace extensions 148 } // namespace extensions
142 149
143 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ 150 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698