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 #include "chrome/renderer/extensions/js_only_v8_extensions.h" | 5 #include "chrome/renderer/extensions/js_only_v8_extensions.h" |
6 | 6 |
7 #include "chrome/renderer/extensions/bindings_utils.h" | 7 #include "chrome/renderer/extensions/extension_base.h" |
8 #include "grit/renderer_resources.h" | 8 #include "grit/renderer_resources.h" |
9 | 9 |
10 using bindings_utils::GetStringResource; | |
11 | |
12 // JsonSchemaJsV8Extension | 10 // JsonSchemaJsV8Extension |
13 const char* JsonSchemaJsV8Extension::kName = "chrome/jsonschema"; | 11 const char* JsonSchemaJsV8Extension::kName = "chrome/jsonschema"; |
14 v8::Extension* JsonSchemaJsV8Extension::Get() { | 12 v8::Extension* JsonSchemaJsV8Extension::Get() { |
15 static v8::Extension* extension = | 13 static v8::Extension* extension = new ExtensionBase( |
16 new bindings_utils::ExtensionBase( | 14 kName, ExtensionBase::GetStringResource(IDR_JSON_SCHEMA_JS), 0, NULL, |
17 kName, GetStringResource(IDR_JSON_SCHEMA_JS), 0, NULL, NULL); | 15 NULL); |
18 return extension; | 16 return extension; |
19 } | 17 } |
20 | 18 |
21 // ExtensionApiTestV8Extension | 19 // ExtensionApiTestV8Extension |
22 const char* ExtensionApiTestV8Extension::kName = "chrome/extensionapitest"; | 20 const char* ExtensionApiTestV8Extension::kName = "chrome/extensionapitest"; |
23 v8::Extension* ExtensionApiTestV8Extension::Get() { | 21 v8::Extension* ExtensionApiTestV8Extension::Get() { |
24 static v8::Extension* extension = | 22 static v8::Extension* extension = new ExtensionBase( |
25 new bindings_utils::ExtensionBase( | 23 kName, ExtensionBase::GetStringResource(IDR_EXTENSION_APITEST_JS), 0, |
26 kName, GetStringResource(IDR_EXTENSION_APITEST_JS), 0, NULL, NULL); | 24 NULL, NULL); |
27 return extension; | 25 return extension; |
28 } | 26 } |
OLD | NEW |