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