OLD | NEW |
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 #ifndef CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_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 ChromeV8Extension; |
13 class ExtensionDispatcher; | 14 class ExtensionDispatcher; |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 class RenderView; | 17 class RenderView; |
17 } | 18 } |
18 | 19 |
19 namespace v8 { | 20 namespace v8 { |
20 class Extension; | 21 class Extension; |
21 } | 22 } |
22 | 23 |
23 namespace extensions { | 24 namespace extensions { |
24 | 25 |
25 // Manually implements some random JavaScript bindings for the extension system. | 26 // Manually implements some random JavaScript bindings for the extension system. |
26 // | 27 // |
27 // TODO(aa): This should all get re-implemented using SchemaGeneratedBindings. | 28 // 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 // If anything needs to be manual for some reason, it should be implemented in |
29 // its own class. | 30 // its own class. |
30 class MiscellaneousBindings { | 31 class MiscellaneousBindings { |
31 public: | 32 public: |
32 // Creates an instance of the extension. | 33 // Creates an instance of the extension. |
33 static v8::Extension* Get(ExtensionDispatcher* dispatcher); | 34 static ChromeV8Extension* Get(ExtensionDispatcher* dispatcher); |
34 | 35 |
35 // Delivers a message sent using content script messaging to some of the | 36 // Delivers a message sent using content script messaging to some of the |
36 // contexts in |bindings_context_set|. If |restrict_to_render_view| is | 37 // contexts in |bindings_context_set|. If |restrict_to_render_view| is |
37 // specified, only contexts in that render view will receive the message. | 38 // specified, only contexts in that render view will receive the message. |
38 static void DeliverMessage( | 39 static void DeliverMessage( |
39 const ChromeV8ContextSet::ContextSet& context_set, | 40 const ChromeV8ContextSet::ContextSet& context_set, |
40 int target_port_id, | 41 int target_port_id, |
41 const std::string& message, | 42 const std::string& message, |
42 content::RenderView* restrict_to_render_view); | 43 content::RenderView* restrict_to_render_view); |
43 }; | 44 }; |
44 | 45 |
45 } // namespace | 46 } // namespace |
46 | 47 |
47 #endif // CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ | 48 #endif // CHROME_RENDERER_EXTENSIONS_MISCELLANEOUS_BINDINGS_H_ |
OLD | NEW |