OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Exposes extension APIs into the extension process. | 5 // Exposes extension APIs into the extension process. |
6 | 6 |
7 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 7 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
8 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 8 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "v8/include/v8.h" | 13 #include "v8/include/v8.h" |
14 | 14 |
15 class WebFrame; | 15 class WebFrame; |
16 | 16 |
17 class ExtensionProcessBindings { | 17 class ExtensionProcessBindings { |
18 public: | 18 public: |
19 struct CallContext { | 19 struct CallContext { |
20 public : | 20 public : |
21 CallContext(WebFrame *frame, const std::string& name) | 21 CallContext(WebFrame *frame, const std::string& name) |
22 : frame_(frame), | 22 : frame_(frame), |
23 name_(name) {} | 23 name_(name) {} |
24 WebFrame* frame_; | 24 WebFrame* frame_; |
25 std::string name_; | 25 std::string name_; |
26 }; | 26 }; |
27 | 27 |
28 static void SetFunctionNames(const std::vector<std::string>& names); | 28 static void SetFunctionNames(const std::vector<std::string>& names); |
29 static v8::Extension* Get(); | 29 static v8::Extension* Get(); |
| 30 static void RegisterExtensionContext(WebFrame* frame); |
30 static void ExecuteResponseInFrame(CallContext *call, int request_id, | 31 static void ExecuteResponseInFrame(CallContext *call, int request_id, |
31 bool success, | 32 bool success, |
32 const std::string& response, | 33 const std::string& response, |
33 const std::string& error); | 34 const std::string& error); |
34 }; | 35 }; |
35 | 36 |
36 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 37 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
OLD | NEW |