[email protected] | 701a94e | 2014-04-17 04:37:37 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_RENDERER_API_DEFINITIONS_NATIVES_H_ |
| 6 | #define EXTENSIONS_RENDERER_API_DEFINITIONS_NATIVES_H_ |
| 7 | |
avi | 2d124c0 | 2015-12-23 06:36:42 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | 701a94e | 2014-04-17 04:37:37 | [diff] [blame] | 9 | #include "extensions/renderer/object_backed_native_handler.h" |
| 10 | #include "v8/include/v8.h" |
| 11 | |
| 12 | namespace extensions { |
| 13 | class Dispatcher; |
| 14 | class ScriptContext; |
| 15 | |
| 16 | // Native functions for JS to get access to the schemas for extension APIs. |
| 17 | class ApiDefinitionsNatives : public ObjectBackedNativeHandler { |
| 18 | public: |
| 19 | ApiDefinitionsNatives(Dispatcher* dispatcher, ScriptContext* context); |
| 20 | |
Devlin Cronin | d9ea834 | 2018-01-27 06:00:04 | [diff] [blame] | 21 | // ObjectBackedNativeHandler: |
| 22 | void AddRoutes() override; |
| 23 | |
[email protected] | 701a94e | 2014-04-17 04:37:37 | [diff] [blame] | 24 | private: |
| 25 | // Returns the list of all schemas that are available to the calling context. |
| 26 | void GetExtensionAPIDefinitionsForTest( |
| 27 | const v8::FunctionCallbackInfo<v8::Value>& args); |
| 28 | |
| 29 | // Not owned. |
| 30 | Dispatcher* dispatcher_; |
| 31 | |
| 32 | DISALLOW_COPY_AND_ASSIGN(ApiDefinitionsNatives); |
| 33 | }; |
| 34 | |
| 35 | } // namespace extensions |
| 36 | |
| 37 | #endif // EXTENSIONS_RENDERER_API_DEFINITIONS_NATIVES_H_ |