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_SCHEMA_GENERATED_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_SCHEMA_GENERATED_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_SCHEMA_GENERATED_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_SCHEMA_GENERATED_BINDINGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 class ChromeV8ContextSet; |
| 12 class ChromeV8Extension; |
11 class ExtensionDispatcher; | 13 class ExtensionDispatcher; |
12 class ChromeV8ContextSet; | |
13 | |
14 namespace v8 { | |
15 class Extension; | |
16 } | |
17 | 14 |
18 namespace extensions { | 15 namespace extensions { |
19 | 16 |
20 // Generates JavaScript bindings for the extension system from the JSON | 17 // Generates JavaScript bindings for the extension system from the JSON |
21 // declarations in chrome/common/extensions/api/. | 18 // declarations in chrome/common/extensions/api/. |
22 class SchemaGeneratedBindings { | 19 class SchemaGeneratedBindings { |
23 public: | 20 public: |
24 static v8::Extension* Get(ExtensionDispatcher* extension_dispatcher); | 21 static ChromeV8Extension* Get(ExtensionDispatcher* extension_dispatcher); |
25 | 22 |
26 // Handles a response to an API request. Sets |extension_id|. | 23 // Handles a response to an API request. Sets |extension_id|. |
27 static void HandleResponse(const ChromeV8ContextSet& contexts, | 24 static void HandleResponse(const ChromeV8ContextSet& contexts, |
28 int request_id, | 25 int request_id, |
29 bool success, | 26 bool success, |
30 const std::string& response, | 27 const std::string& response, |
31 const std::string& error, | 28 const std::string& error, |
32 std::string* extension_id); | 29 std::string* extension_id); |
33 | 30 |
34 static bool HasPendingRequests(const std::string& extension_id); | 31 static bool HasPendingRequests(const std::string& extension_id); |
35 }; | 32 }; |
36 | 33 |
37 } // namespace extensions | 34 } // namespace extensions |
38 | 35 |
39 #endif // CHROME_RENDERER_EXTENSIONS_SCHEMA_GENERATED_BINDINGS_H_ | 36 #endif // CHROME_RENDERER_EXTENSIONS_SCHEMA_GENERATED_BINDINGS_H_ |
OLD | NEW |