| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/renderer/extensions/api_definitions_natives.h" | 5 #include "chrome/renderer/extensions/api_definitions_natives.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/common/extensions/api/extension_api.h" | 9 #include "chrome/common/extensions/api/extension_api.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 const char kInvalidExtensionNamespace[] = "Invalid extension namespace"; | 12 const char kInvalidExtensionNamespace[] = "Invalid extension namespace"; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher, | 17 ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher, |
| 18 ChromeV8Context* context) | 18 ChromeV8Context* context) |
| 19 : ChromeV8Extension(dispatcher, context->v8_context()), | 19 : ChromeV8Extension(dispatcher, context) { |
| 20 context_(context) { | |
| 21 RouteFunction("GetExtensionAPIDefinitions", | 20 RouteFunction("GetExtensionAPIDefinitions", |
| 22 base::Bind(&ApiDefinitionsNatives::GetExtensionAPIDefinitions, | 21 base::Bind(&ApiDefinitionsNatives::GetExtensionAPIDefinitions, |
| 23 base::Unretained(this))); | 22 base::Unretained(this))); |
| 24 } | 23 } |
| 25 | 24 |
| 26 v8::Handle<v8::Value> ApiDefinitionsNatives::GetExtensionAPIDefinitions( | 25 v8::Handle<v8::Value> ApiDefinitionsNatives::GetExtensionAPIDefinitions( |
| 27 const v8::Arguments& args) { | 26 const v8::Arguments& args) { |
| 28 return dispatcher()->v8_schema_registry()->GetSchemas( | 27 return dispatcher()->v8_schema_registry()->GetSchemas( |
| 29 ExtensionAPI::GetSharedInstance()->GetAllAPINames()); | 28 ExtensionAPI::GetSharedInstance()->GetAllAPINames()); |
| 30 } | 29 } |
| 31 | 30 |
| 32 } // namespace extensions | 31 } // namespace extensions |
| OLD | NEW |