summaryrefslogtreecommitdiffstats
path: root/extensions/common/permissions
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-10-15 08:13:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-15 15:14:22 +0000
commitcb9f86e510af9d9d36500b9da8ed4f20f167dbdf (patch)
tree1c918c7963073a9b71c89c820d2ac085b1e3c414 /extensions/common/permissions
parentdde0aefdd81cc4bfd106b9c51300d441397d1af7 (diff)
downloadchromium_src-cb9f86e510af9d9d36500b9da8ed4f20f167dbdf.zip
chromium_src-cb9f86e510af9d9d36500b9da8ed4f20f167dbdf.tar.gz
chromium_src-cb9f86e510af9d9d36500b9da8ed4f20f167dbdf.tar.bz2
[Extensions] Refactor click-to-script permissioning
Click-to-script allows users to withhold all-hosts and all-hosts-like permissions, but the code to do this is pretty staggered. Consolidate more of it into a single class Review URL: https://codereview.chromium.org/1397443011 Cr-Commit-Position: refs/heads/master@{#354271}
Diffstat (limited to 'extensions/common/permissions')
-rw-r--r--extensions/common/permissions/permissions_data.cc15
-rw-r--r--extensions/common/permissions/permissions_data.h8
2 files changed, 0 insertions, 23 deletions
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index 7c001a5..ea66b6c 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -72,21 +72,6 @@ bool PermissionsData::CanExecuteScriptEverywhere(const Extension* extension) {
}
// static
-bool PermissionsData::ScriptsMayRequireActionForExtension(
- const Extension* extension,
- const PermissionSet& permissions) {
- // An extension may require user action to execute scripts iff the extension
- // shows up in chrome:extensions (so the user can grant withheld permissions),
- // is not part of chrome or corporate policy, not on the scripting whitelist,
- // and requires enough permissions that we should withhold them.
- return extension->ShouldDisplayInExtensionSettings() &&
- !Manifest::IsPolicyLocation(extension->location()) &&
- !Manifest::IsComponentLocation(extension->location()) &&
- !CanExecuteScriptEverywhere(extension) &&
- permissions.ShouldWarnAllHosts();
-}
-
-// static
bool PermissionsData::ShouldSkipPermissionWarnings(
const std::string& extension_id) {
// See http://b/4946060 for more details.
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h
index 19fbe02..5de25c2 100644
--- a/extensions/common/permissions/permissions_data.h
+++ b/extensions/common/permissions/permissions_data.h
@@ -72,14 +72,6 @@ class PermissionsData {
// whitelist of extensions that can script all pages.
static bool CanExecuteScriptEverywhere(const Extension* extension);
- // Returns true if the --scripts-require-action flag would possibly affect
- // 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.
- static bool ScriptsMayRequireActionForExtension(
- const Extension* extension,
- const PermissionSet& permissions);
-
// Returns true if we should skip the permissions warning for the extension
// with the given |extension_id|.
static bool ShouldSkipPermissionWarnings(const std::string& extension_id);