| 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 source_map_.RegisterSource("apitest", IDR_EXTENSION_APITEST_JS); | 553 source_map_.RegisterSource("apitest", IDR_EXTENSION_APITEST_JS); |
| 554 | 554 |
| 555 // Libraries. | 555 // Libraries. |
| 556 source_map_.RegisterSource("schemaUtils", IDR_SCHEMA_UTILS_JS); | 556 source_map_.RegisterSource("schemaUtils", IDR_SCHEMA_UTILS_JS); |
| 557 source_map_.RegisterSource("sendRequest", IDR_SEND_REQUEST_JS); | 557 source_map_.RegisterSource("sendRequest", IDR_SEND_REQUEST_JS); |
| 558 source_map_.RegisterSource("setIcon", IDR_SET_ICON_JS); | 558 source_map_.RegisterSource("setIcon", IDR_SET_ICON_JS); |
| 559 source_map_.RegisterSource("utils", IDR_UTILS_JS); | 559 source_map_.RegisterSource("utils", IDR_UTILS_JS); |
| 560 | 560 |
| 561 // Custom bindings. | 561 // Custom bindings. |
| 562 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); | 562 source_map_.RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); |
| 563 source_map_.RegisterSource("appWindow", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS); | 563 source_map_.RegisterSource("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS); |
| 564 source_map_.RegisterSource("browserAction", | 564 source_map_.RegisterSource("browserAction", |
| 565 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); | 565 IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS); |
| 566 source_map_.RegisterSource("contentSettings", | 566 source_map_.RegisterSource("contentSettings", |
| 567 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); | 567 IDR_CONTENT_SETTINGS_CUSTOM_BINDINGS_JS); |
| 568 source_map_.RegisterSource("contextMenus", | 568 source_map_.RegisterSource("contextMenus", |
| 569 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); | 569 IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS); |
| 570 source_map_.RegisterSource("declarativeWebRequest", | 570 source_map_.RegisterSource("declarativeWebRequest", |
| 571 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); | 571 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS); |
| 572 source_map_.RegisterSource("devtools", IDR_DEVTOOLS_CUSTOM_BINDINGS_JS); | 572 source_map_.RegisterSource("devtools", IDR_DEVTOOLS_CUSTOM_BINDINGS_JS); |
| 573 source_map_.RegisterSource("experimental.app", | 573 source_map_.RegisterSource("experimental.app", |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 // APIs, they don't get extension bindings injected. If we end up here it | 1015 // APIs, they don't get extension bindings injected. If we end up here it |
| 1016 // means that a sandboxed page somehow managed to invoke an API anyway, so | 1016 // means that a sandboxed page somehow managed to invoke an API anyway, so |
| 1017 // we should abort. | 1017 // we should abort. |
| 1018 WebKit::WebFrame* frame = context->web_frame(); | 1018 WebKit::WebFrame* frame = context->web_frame(); |
| 1019 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1019 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
| 1020 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1020 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
| 1021 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1021 CHECK(!extensions_.IsSandboxedPage(url_info)); |
| 1022 | 1022 |
| 1023 return true; | 1023 return true; |
| 1024 } | 1024 } |
| OLD | NEW |