summaryrefslogtreecommitdiffstats
path: root/extensions/common
diff options
context:
space:
mode:
authordxie@chromium.org <dxie@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-01 02:16:45 +0000
committerdxie@chromium.org <dxie@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-01 02:16:45 +0000
commit815e782b5419feb4f578458928c7f71747b89939 (patch)
treee5c29ea71b4f6408c20caf6d8919621d6f18c55a /extensions/common
parentbd5792875611d8f0bc059293a11b2d2d778c04ed (diff)
downloadchromium_src-815e782b5419feb4f578458928c7f71747b89939.zip
chromium_src-815e782b5419feb4f578458928c7f71747b89939.tar.gz
chromium_src-815e782b5419feb4f578458928c7f71747b89939.tar.bz2
Revert 273866 "Block content scripts from executing until user g..."
Referring to https://code.google.com/p/chromium/issues/detail?id=379472, This is causing significant stability on trunk. Reverting. > Block content scripts from executing until user grants permission > > Prevent extensions with <all_urls> from running content scripts without user > consent if the scripts-require-action switch is on. > > BUG=362353 > > Review URL: https://codereview.chromium.org/288053002 TBR=rdevlin.cronin@chromium.org Review URL: https://codereview.chromium.org/307933008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common')
-rw-r--r--extensions/common/extension_messages.h23
-rw-r--r--extensions/common/permissions/permissions_data.cc7
-rw-r--r--extensions/common/user_script.h2
3 files changed, 7 insertions, 25 deletions
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index 5e272c6..9bb15ab 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -359,11 +359,8 @@ IPC_MESSAGE_ROUTED1(ExtensionMsg_ExecuteCode,
// Notification that the user scripts have been updated. It has one
// SharedMemoryHandle argument consisting of the pickled script data. This
// handle is valid in the context of the renderer.
-// If |changed_extensions| is not empty, only the extensions in that set will
-// be updated. Otherwise, all extensions will be updated.
-IPC_MESSAGE_CONTROL2(ExtensionMsg_UpdateUserScripts,
- base::SharedMemoryHandle,
- std::set<std::string> /* changed extensions */)
+IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateUserScripts,
+ base::SharedMemoryHandle)
// Tell the render view which browser window it's being attached to.
IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId,
@@ -575,21 +572,9 @@ IPC_MESSAGE_ROUTED3(ExtensionHostMsg_ContentScriptsExecuting,
int32 /* page_id of the _topmost_ frame */,
GURL /* url of the _topmost_ frame */)
-// Sent from the renderer to the browser to request permission for a content
-// script to execute on a given page.
-// If request id is -1, this signals that the request has already ran, and this
-// merely serves as a notification. This happens when the feature to disable
-// scripts running without user consent is not enabled.
-IPC_MESSAGE_ROUTED3(ExtensionHostMsg_RequestContentScriptPermission,
+IPC_MESSAGE_ROUTED2(ExtensionHostMsg_NotifyExtensionScriptExecution,
std::string /* extension id */,
- int /* page id */,
- int /* request id */)
-
-// Sent from the browser to the renderer in reply to a
-// RequestContentScriptPermission message, granting permission for a content
-// script to run.
-IPC_MESSAGE_ROUTED1(ExtensionMsg_GrantContentScriptPermission,
- int /* request id */)
+ int /* page id */)
// Sent by the renderer when a web page is checking if its app is installed.
IPC_MESSAGE_ROUTED3(ExtensionHostMsg_GetAppInstallState,
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index 8fde199..85000a2 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -584,13 +584,12 @@ bool PermissionsData::RequiresActionForScriptExecution(
int tab_id,
const GURL& url) {
// For now, the user should be notified when an extension with all hosts
- // permission tries to execute a script on a page. Exceptions for policy-
- // enabled and component extensions, and extensions which are whitelisted to
- // execute scripts everywhere.
+ // permission tries to execute a script on a page, with exceptions for policy-
+ // enabled and component extensions. If this doesn't meet those criteria,
+ // return immediately.
if (!extension->ShouldDisplayInExtensionSettings() ||
Manifest::IsPolicyLocation(extension->location()) ||
Manifest::IsComponentLocation(extension->location()) ||
- CanExecuteScriptEverywhere(extension) ||
!ShouldWarnAllHosts(extension)) {
return false;
}
diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h
index cedfc16a..05974c7 100644
--- a/extensions/common/user_script.h
+++ b/extensions/common/user_script.h
@@ -45,8 +45,6 @@ class UserScript {
// is "idle". Currently this uses the simple heuristic of:
// min(DOM_CONTENT_LOADED + TIMEOUT, ONLOAD), but no
// particular injection point is guaranteed.
- RUN_DEFERRED, // The user script's injection was deferred for permissions
- // reasons, and was executed at a later time.
RUN_LOCATION_LAST // Leave this as the last item.
};