OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 11 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
12 | 12 |
13 class ExtensionDispatcher; | 13 class ExtensionDispatcher; |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class RenderView; | 16 class RenderView; |
17 } | 17 } |
18 | 18 |
19 namespace v8 { | 19 namespace v8 { |
20 class Extension; | 20 class Extension; |
21 } | 21 } |
22 | 22 |
23 // This class adds extension-related javascript bindings to a renderer. It is | 23 namespace extensions { |
24 // used by both web renderers and extension processes. | 24 |
25 class RendererExtensionBindings { | 25 // Manually implements some random JavaScript bindings for the extension system. |
| 26 // |
| 27 // TODO(aa): This should all get re-implemented using SchemaGeneratedBindings. |
| 28 // If anything needs to be manual for some reason, it should be implemented in |
| 29 // its own class. |
| 30 class MiscellaneousBindings { |
26 public: | 31 public: |
27 // Creates an instance of the extension. | 32 // Creates an instance of the extension. |
28 static v8::Extension* Get(ExtensionDispatcher* dispatcher); | 33 static v8::Extension* Get(ExtensionDispatcher* dispatcher); |
29 | 34 |
30 // Delivers a message sent using content script messaging to some of the | 35 // Delivers a message sent using content script messaging to some of the |
31 // contexts in |bindings_context_set|. If |restrict_to_render_view| is | 36 // contexts in |bindings_context_set|. If |restrict_to_render_view| is |
32 // specified, only contexts in that render view will receive the message. | 37 // specified, only contexts in that render view will receive the message. |
33 static void DeliverMessage( | 38 static void DeliverMessage( |
34 const ChromeV8ContextSet::ContextSet& context_set, | 39 const ChromeV8ContextSet::ContextSet& context_set, |
35 int target_port_id, | 40 int target_port_id, |
36 const std::string& message, | 41 const std::string& message, |
37 content::RenderView* restrict_to_render_view); | 42 content::RenderView* restrict_to_render_view); |
38 }; | 43 }; |
39 | 44 |
40 #endif // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | 45 } // namespace |
| 46 |
| 47 #endif // CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ |
OLD | NEW |