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

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

Issue 6894045: wip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/bindings_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/bindings_utils.h
diff --git a/chrome/renderer/extensions/bindings_utils.h b/chrome/renderer/extensions/bindings_utils.h
index f2c96dffca004f19f29c55d37ddd09824e61dbbf..ae3fafdf586a92ab2d6885df680fa61260a6c8e7 100644
--- a/chrome/renderer/extensions/bindings_utils.h
+++ b/chrome/renderer/extensions/bindings_utils.h
@@ -15,6 +15,8 @@
#include <list>
#include <string>
+class Extension;
+class ExtensionDispatcher;
class RenderView;
namespace WebKit {
@@ -30,13 +32,11 @@ class ExtensionBase : public v8::Extension {
ExtensionBase(const char* name,
const char* source,
int dep_count,
- const char** deps)
- : v8::Extension(name, source, dep_count, deps) {}
-
- // Note: do not call this function before or during the chromeHidden.onLoad
- // event dispatch. The URL might not have been committed yet and might not
- // be an extension URL.
- static std::string ExtensionIdForCurrentContext();
+ const char** deps,
+ ExtensionDispatcher* extension_dispatcher)
+ : v8::Extension(name, source, dep_count, deps),
+ extension_dispatcher_(extension_dispatcher) {
+ }
// Derived classes should call this at the end of their implementation in
// order to expose common native functions, like GetChromeHidden, to the
@@ -45,6 +45,13 @@ class ExtensionBase : public v8::Extension {
GetNativeFunction(v8::Handle<v8::String> name);
protected:
+ // Note: do not call this function before or during the chromeHidden.onLoad
+ // event dispatch. The URL might not have been committed yet and might not
+ // be an extension URL.
+ const Extension* GetExtensionForCurrentContext(
+ v8::Handle<v8::Context> context);
+ bool CheckPermissionForCurrentContext(const std::string& function_name);
+
// Returns a hidden variable for use by the bindings that is unreachable
// by the page.
static v8::Handle<v8::Value> GetChromeHidden(const v8::Arguments& args);
« no previous file with comments | « chrome/common/extensions/extension_messages.h ('k') | chrome/renderer/extensions/bindings_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698