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

Unified Diff: chrome/browser/extensions/api/declarative/declarative_api.cc

Issue 10823247: In the declarative API, check that the extension has permission for the event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup 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
« no previous file with comments | « chrome/browser/extensions/api/declarative/declarative_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/declarative_api.cc
diff --git a/chrome/browser/extensions/api/declarative/declarative_api.cc b/chrome/browser/extensions/api/declarative/declarative_api.cc
index 8c9b856832d02efdb34ffb48d3d9741a618cb0fc..ce226fd6f844af5d5bb6f93f5ab77440cc1c965a 100644
--- a/chrome/browser/extensions/api/declarative/declarative_api.cc
+++ b/chrome/browser/extensions/api/declarative/declarative_api.cc
@@ -42,6 +42,12 @@ RulesFunction::RulesFunction() : rules_registry_(NULL) {}
RulesFunction::~RulesFunction() {}
+bool RulesFunction::HasPermission() {
+ std::string event_name;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &event_name));
+ return extension_->HasAPIPermission(event_name);
+}
+
bool RulesFunction::RunImpl() {
std::string event_name;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &event_name));
« no previous file with comments | « chrome/browser/extensions/api/declarative/declarative_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698