From 9fb990b32d4de5697fa848e03a6bf4d11fcd0417 Mon Sep 17 00:00:00 2001 From: "koz@chromium.org" Date: Tue, 13 Mar 2012 02:09:41 +0000 Subject: 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 --- chrome/renderer/extensions/app_bindings.h | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'chrome/renderer/extensions/app_bindings.h') 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 GetIsInstalled(const v8::Arguments& args); + v8::Handle Install(const v8::Arguments& args); + v8::Handle GetDetails(const v8::Arguments& args); + v8::Handle GetDetailsForFrame(const v8::Arguments& args); + v8::Handle GetAppNotifyChannel(const v8::Arguments& args); + + v8::Handle GetDetailsForFrameImpl(WebKit::WebFrame* frame); + + void OnGetAppNotifyChannelResponse(const std::string& channel_id, + const std::string& error, + int callback_id); + DISALLOW_COPY_AND_ASSIGN(AppBindings); }; -- cgit v1.1