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_RENDERER_EXTENSION_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 class ExtensionDispatcher; | 11 class ExtensionDispatcher; |
| 12 class RenderView; |
10 | 13 |
11 namespace v8 { | 14 namespace v8 { |
12 class Extension; | 15 class Extension; |
13 } | 16 } |
14 | 17 |
15 // This class adds extension-related javascript bindings to a renderer. It is | 18 // This class adds extension-related javascript bindings to a renderer. It is |
16 // used by both web renderers and extension processes. | 19 // used by both web renderers and extension processes. |
17 class RendererExtensionBindings { | 20 class RendererExtensionBindings { |
18 public: | 21 public: |
19 // Name of extension, for dependencies. | 22 // Name of extension, for dependencies. |
20 static const char* kName; | 23 static const char* kName; |
21 | 24 |
22 // Creates an instance of the extension. | 25 // Creates an instance of the extension. |
23 static v8::Extension* Get(ExtensionDispatcher* dispatcher); | 26 static v8::Extension* Get(ExtensionDispatcher* dispatcher); |
| 27 |
| 28 // Delivers a message sent using content script messaging. If |
| 29 // restrict_to_render_view is specified, only contexts in that render view |
| 30 // will receive the message. |
| 31 static void DeliverMessage(int target_port_id, const std::string& message, |
| 32 RenderView* restrict_to_render_view); |
24 }; | 33 }; |
25 | 34 |
26 #endif // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | 35 #endif // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ |
OLD | NEW |