summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/user_script_slave.cc
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:22:57 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:22:57 +0000
commitfc5e65d6b7066e8858fe157c23ed834b4dd1fded (patch)
tree30c8bd3916dd1f0a9720e1385f1e389f287c5f21 /chrome/renderer/extensions/user_script_slave.cc
parent242e4d9c7efcb6e14eef2b5657b012259ea97d63 (diff)
downloadchromium_src-fc5e65d6b7066e8858fe157c23ed834b4dd1fded.zip
chromium_src-fc5e65d6b7066e8858fe157c23ed834b4dd1fded.tar.gz
chromium_src-fc5e65d6b7066e8858fe157c23ed834b4dd1fded.tar.bz2
Implement the activeTab permission, so that extensions with the permission
that get tab-specific permissions granted (currently, only via clicking a browser action, but this will expand) can executeScript and captureVisibleTab on that tab only, until the next page navigation or refresh. BUG=93903 Review URL: https://chromiumcodereview.appspot.com/10443105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/user_script_slave.cc')
-rw-r--r--chrome/renderer/extensions/user_script_slave.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc
index 8862631..9ddaf4d 100644
--- a/chrome/renderer/extensions/user_script_slave.cc
+++ b/chrome/renderer/extensions/user_script_slave.cc
@@ -279,8 +279,14 @@ void UserScriptSlave::InjectScripts(WebFrame* frame,
if (!extension)
continue;
- if (!extension->CanExecuteScriptOnPage(data_source_url, script, NULL))
+ // Content scripts are not tab-specific.
+ int kNoTabId = -1;
+ if (!extension->CanExecuteScriptOnPage(data_source_url,
+ kNoTabId,
+ script,
+ NULL)) {
continue;
+ }
// We rely on WebCore for CSS injection, but it's still useful to know how
// many css files there are.