diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 02:09:41 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 02:09:41 +0000 |
commit | 9fb990b32d4de5697fa848e03a6bf4d11fcd0417 (patch) | |
tree | c6dd811b2fd92bf95afe4107e3f78ae86e255319 /chrome/renderer/extensions/app_bindings.h | |
parent | af885dd7caf0455a05f15aac48fa221191266706 (diff) | |
download | chromium_src-9fb990b32d4de5697fa848e03a6bf4d11fcd0417.zip chromium_src-9fb990b32d4de5697fa848e03a6bf4d11fcd0417.tar.gz chromium_src-9fb990b32d4de5697fa848e03a6bf4d11fcd0417.tar.bz2 |
Implement a module system for the extension bindings JS.
BUG=104100
TEST=existing browser tests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125132
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125801
Review URL: http://codereview.chromium.org/9386001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/app_bindings.h')
-rw-r--r-- | chrome/renderer/extensions/app_bindings.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/chrome/renderer/extensions/app_bindings.h b/chrome/renderer/extensions/app_bindings.h index 9455ba2..e27c770 100644 --- a/chrome/renderer/extensions/app_bindings.h +++ b/chrome/renderer/extensions/app_bindings.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,21 +14,34 @@ #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; // Implements the chrome.app JavaScript object. // // TODO(aa): Add unit testing for this class. -class AppBindings : public ChromeV8Extension { +class AppBindings : public ChromeV8Extension, public ChromeV8ExtensionHandler { public: - explicit AppBindings(ExtensionDispatcher* dispatcher); - - protected: - virtual ChromeV8ExtensionHandler* CreateHandler( - ChromeV8Context* context) OVERRIDE; + explicit AppBindings(ExtensionDispatcher* dispatcher, + ChromeV8Context* context); private: + // IPC::Channel::Listener + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + + 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); + DISALLOW_COPY_AND_ASSIGN(AppBindings); }; |