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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 10829186: Tabs API is usable without tabs permission. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ETU now SetString()'s for empty values Created 8 years, 4 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/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index a99c15935473a4c5b865a7f98a3995dc21a5c227..e69857ea8974cd841b6e95229937d1b3751ecf3a 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -1066,19 +1066,7 @@ bool Dispatcher::CheckCurrentContextAccessToExtensionAPI(
return false;
}
- // We need to whitelist tabs.executeScript and tabs.insertCSS because they
- // are granted under special circumstances with the activeTab permission
- // (note that the browser checks too, so this isn't a security problem).
- //
- // Only the browser knows which tab this call will be sent to... sometimes we
- // *could* figure it out (if the extension gives an explicit tab ID in the
- // call), but the expected case will be the extension passing through -1,
- // meaning the active tab, and only the browser safely knows what this is.
- bool skip_permission_check = (function_name == "tabs.executeScript") ||
- (function_name == "tabs.insertCSS");
-
- if (!skip_permission_check &&
- !context->extension()->HasAPIPermission(function_name)) {
+ if (!context->extension()->HasAPIPermission(function_name)) {
static const char kMessage[] =
"You do not have permission to use '%s'. Be sure to declare"
" in your manifest what permissions you need.";

Powered by Google App Engine
This is Rietveld 408576698