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

Unified Diff: chrome/browser/extensions/extension_util.h

Issue 874683005: [Extensions] Enable the scripts-require-action feature based on all-urls pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated metrics Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | chrome/browser/extensions/extension_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_util.h
diff --git a/chrome/browser/extensions/extension_util.h b/chrome/browser/extensions/extension_util.h
index 724050035a52d23f7e67b7a8e812116353cbd2af..4535e9907208264b8d278dcb341a648827300e14 100644
--- a/chrome/browser/extensions/extension_util.h
+++ b/chrome/browser/extensions/extension_util.h
@@ -26,6 +26,7 @@ namespace extensions {
class Extension;
struct ExtensionInfo;
+class PermissionSet;
namespace util {
@@ -68,6 +69,9 @@ void SetAllowFileAccess(const std::string& extension_id,
bool AllowedScriptingOnAllUrls(const std::string& extension_id,
content::BrowserContext* context);
+// Returns the default value for being allowed to script on all urls.
+bool DefaultAllowedScriptingOnAllUrls();
+
// Sets whether the extension with |extension_id| is allowed to execute scripts
// on all urls (exempting chrome:// urls, etc) without explicit user consent.
// This should only be used with FeatureSwitch::scripts_require_action()
@@ -77,8 +81,12 @@ void SetAllowedScriptingOnAllUrls(const std::string& extension_id,
bool allowed);
// Returns true if the --scripts-require-action flag would possibly affect
-// the given |extension|.
-bool ScriptsMayRequireActionForExtension(const Extension* extension);
+// the given |extension| and |permissions|. We pass in the |permissions|
+// explicitly, as we may need to check with permissions other than the ones
+// that are currently on the extension's PermissionsData.
+bool ScriptsMayRequireActionForExtension(
+ const Extension* extension,
+ const PermissionSet* permissions);
// Returns true if |extension_id| can be launched (possibly only after being
// enabled).
« no previous file with comments | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | chrome/browser/extensions/extension_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698