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
3 // found in the LICENSE file.
5 #include "chrome/renderer/extensions/api_definitions_natives.h"
9 #include "chrome/common/extensions/api/extension_api.h"
12 const char kInvalidExtensionNamespace
[] = "Invalid extension namespace";
15 namespace extensions
{
17 ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher
* dispatcher
,
18 ChromeV8Context
* context
)
19 : ChromeV8Extension(dispatcher
, context
->v8_context()),
21 RouteFunction("GetExtensionAPIDefinitions",
22 base::Bind(&ApiDefinitionsNatives::GetExtensionAPIDefinitions
,
23 base::Unretained(this)));
26 v8::Handle
<v8::Value
> ApiDefinitionsNatives::GetExtensionAPIDefinitions(
27 const v8::Arguments
& args
) {
28 return dispatcher()->v8_schema_registry()->GetSchemas(
29 ExtensionAPI::GetSharedInstance()->GetAllAPINames());
32 } // namespace extensions