| 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/extension_dispatcher.h" | 5 #include "chrome/renderer/extensions/extension_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 source_map_.RegisterSource("miscellaneous_bindings", | 497 source_map_.RegisterSource("miscellaneous_bindings", |
| 498 IDR_MISCELLANEOUS_BINDINGS_JS); | 498 IDR_MISCELLANEOUS_BINDINGS_JS); |
| 499 source_map_.RegisterSource("schema_generated_bindings", | 499 source_map_.RegisterSource("schema_generated_bindings", |
| 500 IDR_SCHEMA_GENERATED_BINDINGS_JS); | 500 IDR_SCHEMA_GENERATED_BINDINGS_JS); |
| 501 source_map_.RegisterSource("json_schema", IDR_JSON_SCHEMA_JS); | 501 source_map_.RegisterSource("json_schema", IDR_JSON_SCHEMA_JS); |
| 502 source_map_.RegisterSource("apitest", IDR_EXTENSION_APITEST_JS); | 502 source_map_.RegisterSource("apitest", IDR_EXTENSION_APITEST_JS); |
| 503 | 503 |
| 504 // Libraries. | 504 // Libraries. |
| 505 source_map_.RegisterSource("sendRequest", IDR_SEND_REQUEST_JS); | 505 source_map_.RegisterSource("sendRequest", IDR_SEND_REQUEST_JS); |
| 506 source_map_.RegisterSource("setIcon", IDR_SET_ICON_JS); | 506 source_map_.RegisterSource("setIcon", IDR_SET_ICON_JS); |
| 507 source_map_.RegisterSource("utils", IDR_UTILS_JS); |
| 507 | 508 |
| 508 // Custom bindings. | 509 // Custom bindings. |
| 509 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); | 510 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); |
| 510 source_map_.RegisterSource("browserAction", | 511 source_map_.RegisterSource("browserAction", |
| 511 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); | 512 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); |
| 512 source_map_.RegisterSource("contentSettings", | 513 source_map_.RegisterSource("contentSettings", |
| 513 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); | 514 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); |
| 514 source_map_.RegisterSource("contextMenus", | 515 source_map_.RegisterSource("contextMenus", |
| 515 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); | 516 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); |
| 516 source_map_.RegisterSource("declarative", | |
| 517 IDR_DECLARATIVE_CUSTOM_BINDINGS_JS); | |
| 518 source_map_.RegisterSource("declarativeWebRequest", | 517 source_map_.RegisterSource("declarativeWebRequest", |
| 519 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); | 518 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); |
| 520 source_map_.RegisterSource("devtools", IDR_DEVTOOLS_CUSTOM_BINDINGS_JS); | 519 source_map_.RegisterSource("devtools", IDR_DEVTOOLS_CUSTOM_BINDINGS_JS); |
| 521 source_map_.RegisterSource("experimental.offscreen", | 520 source_map_.RegisterSource("experimental.offscreen", |
| 522 IDR_EXPERIMENTAL_OFFSCREENTABS_CUSTOM_BINDINGS_JS); | 521 IDR_EXPERIMENTAL_OFFSCREENTABS_CUSTOM_BINDINGS_JS); |
| 523 source_map_.RegisterSource("experimental.runtime", | 522 source_map_.RegisterSource("experimental.runtime", |
| 524 IDR_EXPERIMENTAL_RUNTIME_CUSTOM_BINDINGS_JS); | 523 IDR_EXPERIMENTAL_RUNTIME_CUSTOM_BINDINGS_JS); |
| 525 source_map_.RegisterSource("experimental.usb", | 524 source_map_.RegisterSource("experimental.usb", |
| 526 IDR_EXPERIMENTAL_USB_CUSTOM_BINDINGS_JS); | 525 IDR_EXPERIMENTAL_USB_CUSTOM_BINDINGS_JS); |
| 527 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); | 526 source_map_.RegisterSource("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 static const char kMessage[] = | 892 static const char kMessage[] = |
| 894 "%s can only be used in an extension process."; | 893 "%s can only be used in an extension process."; |
| 895 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 894 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 896 v8::ThrowException( | 895 v8::ThrowException( |
| 897 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 896 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 898 return false; | 897 return false; |
| 899 } | 898 } |
| 900 | 899 |
| 901 return true; | 900 return true; |
| 902 } | 901 } |
| OLD | NEW |