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

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: 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
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..09904bba482e6333858a8d0631c82c4693be7042 100644
--- a/chrome/browser/extensions/extension_util.h
+++ b/chrome/browser/extensions/extension_util.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "url/gurl.h"
@@ -26,6 +27,7 @@ namespace extensions {
class Extension;
struct ExtensionInfo;
+class PermissionSet;
namespace util {
@@ -68,6 +70,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 +82,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 scoped_refptr<const PermissionSet>& permissions);
not at google - send to devlin 2015/02/06 00:26:56 A little odd to be passing refcounted |extension|
Devlin 2015/02/06 18:58:43 Done.
// Returns true if |extension_id| can be launched (possibly only after being
// enabled).

Powered by Google App Engine
This is Rietveld 408576698