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

Side by Side 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: rebase Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_renderer.gypi ('k') | chrome/renderer/extensions/app_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The AppObjectExtension is a v8 extension that creates an object 5 // The AppObjectExtension is a v8 extension that creates an object
6 // at window.chrome.app. This object allows javascript to get details 6 // at window.chrome.app. This object allows javascript to get details
7 // on the app state of the page. 7 // on the app state of the page.
8 // The read-only property app.isInstalled is true if the current page is 8 // The read-only property app.isInstalled is true if the current page is
9 // within the extent of an installed, enabled app. 9 // within the extent of an installed, enabled app.
10 10
11 #ifndef CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_ 11 #ifndef CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_
12 #define CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_ 12 #define CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_
13 #pragma once 13 #pragma once
14 14
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "chrome/renderer/extensions/chrome_v8_extension.h" 16 #include "chrome/renderer/extensions/chrome_v8_extension.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
17 18
18 class ChromeV8Context; 19 class ChromeV8Context;
19 20
20 // Implements the chrome.app JavaScript object. 21 // Implements the chrome.app JavaScript object.
21 // 22 //
22 // TODO(aa): Add unit testing for this class. 23 // TODO(aa): Add unit testing for this class.
23 class AppBindings : public ChromeV8Extension { 24 class AppBindings : public ChromeV8Extension, public ChromeV8ExtensionHandler {
24 public: 25 public:
25 explicit AppBindings(ExtensionDispatcher* dispatcher); 26 explicit AppBindings(ExtensionDispatcher* dispatcher,
26 27 ChromeV8Context* context);
27 protected:
28 virtual ChromeV8ExtensionHandler* CreateHandler(
29 ChromeV8Context* context) OVERRIDE;
30 28
31 private: 29 private:
30 // IPC::Channel::Listener
31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
32
33 v8::Handle<v8::Value> GetIsInstalled(const v8::Arguments& args);
34 v8::Handle<v8::Value> Install(const v8::Arguments& args);
35 v8::Handle<v8::Value> GetDetails(const v8::Arguments& args);
36 v8::Handle<v8::Value> GetDetailsForFrame(const v8::Arguments& args);
37 v8::Handle<v8::Value> GetAppNotifyChannel(const v8::Arguments& args);
38
39 v8::Handle<v8::Value> GetDetailsForFrameImpl(WebKit::WebFrame* frame);
40
41 void OnGetAppNotifyChannelResponse(const std::string& channel_id,
42 const std::string& error,
43 int callback_id);
44
32 DISALLOW_COPY_AND_ASSIGN(AppBindings); 45 DISALLOW_COPY_AND_ASSIGN(AppBindings);
33 }; 46 };
34 47
35 #endif // CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_ 48 #endif // CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_
OLDNEW
« no previous file with comments | « chrome/chrome_renderer.gypi ('k') | chrome/renderer/extensions/app_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698