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

Unified Diff: chrome/renderer/extensions/extension_process_bindings.h

Issue 164039: Add module-level permissions to extensions. (Closed)
Patch Set: final nits Created 11 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/extension_process_bindings.h
diff --git a/chrome/renderer/extensions/extension_process_bindings.h b/chrome/renderer/extensions/extension_process_bindings.h
index 1ce6b475ef831a29d69fed06d564309ab65df327..dd212c5c260a4bdc7d4fa39ec836d69606aefd92 100644
--- a/chrome/renderer/extensions/extension_process_bindings.h
+++ b/chrome/renderer/extensions/extension_process_bindings.h
@@ -26,6 +26,20 @@ class ExtensionProcessBindings {
// Sets the page action ids for a particular extension.
static void SetPageActions(const std::string& extension_id,
const std::vector<std::string>& page_actions);
+
+ // Sets the permissions for a particular extension.
+ static void SetPermissions(const std::string& extension_id,
+ const std::vector<std::string>& permissions);
+
+ // Check if the extension in the currently running context has permission to
+ // access the given extension function. Must be called with a valid V8
+ // context in scope.
+ static bool CurrentContextHasPermission(const std::string& function_name);
+
+ // Throw a V8 exception indicating that permission to access function_name was
+ // denied. Must be called with a valid V8 context in scope.
+ static v8::Handle<v8::Value> ThrowPermissionDeniedException(
+ const std::string& function_name);
};
#endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_
« no previous file with comments | « chrome/renderer/extensions/event_bindings.cc ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698