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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/app_bindings.h
diff --git a/chrome/renderer/extensions/app_bindings.h b/chrome/renderer/extensions/app_bindings.h
index 9455ba2a9fc2c1a33e662efdffcef519b51a8728..5970fd338545ef79782ea195ab2bef462dd33fd3 100644
--- a/chrome/renderer/extensions/app_bindings.h
+++ b/chrome/renderer/extensions/app_bindings.h
@@ -14,21 +14,44 @@
#include "base/compiler_specific.h"
#include "chrome/renderer/extensions/chrome_v8_extension.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
class ChromeV8Context;
+using WebKit::WebFrame;
+
// Implements the chrome.app JavaScript object.
//
// TODO(aa): Add unit testing for this class.
-class AppBindings : public ChromeV8Extension {
+class AppBindings : public ChromeV8Extension, public ChromeV8ExtensionHandler {
Aaron Boodman 2012/02/16 01:54:42 This is multiple inheritance, which is typically d
koz (OOO until 15th September) 2012/02/27 01:06:14 It's possible, but it would be quite messy. It's p
Aaron Boodman 2012/02/28 02:42:59 In that case, I prefer the multiple inheritance.
public:
- explicit AppBindings(ExtensionDispatcher* dispatcher);
+ explicit AppBindings(ExtensionDispatcher* dispatcher,
+ ChromeV8Context* context);
+ virtual ~AppBindings();
+
+ // ChromeV8Extension
+ virtual void SetNativeFunctions(v8::Handle<v8::Object> object) OVERRIDE;
+ virtual v8::Handle<v8::Value> HandleNativeFunction(
+ const std::string& name,
+ const v8::Arguments& arguments) OVERRIDE;
- protected:
- virtual ChromeV8ExtensionHandler* CreateHandler(
- ChromeV8Context* context) OVERRIDE;
+ // IPC::Channel::Listener
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
+ v8::Handle<v8::Value> GetIsInstalled(const v8::Arguments& args);
+ v8::Handle<v8::Value> Install(const v8::Arguments& args);
+ v8::Handle<v8::Value> GetDetails(const v8::Arguments& args);
+ v8::Handle<v8::Value> GetDetailsForFrame(const v8::Arguments& args);
+ v8::Handle<v8::Value> GetAppNotifyChannel(const v8::Arguments& args);
+
+ v8::Handle<v8::Value> GetDetailsForFrameImpl(WebKit::WebFrame* frame);
+
+ void OnGetAppNotifyChannelResponse(const std::string& channel_id,
+ const std::string& error,
+ int callback_id);
+
+ ExtensionDispatcher* dispatcher_;
DISALLOW_COPY_AND_ASSIGN(AppBindings);
};

Powered by Google App Engine
This is Rietveld 408576698