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/dispatcher.h" | 5 #include "chrome/renderer/extensions/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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 796 |
797 break; | 797 break; |
798 } | 798 } |
799 } | 799 } |
800 | 800 |
801 // Inject custom JS into the platform app context. | 801 // Inject custom JS into the platform app context. |
802 if (IsWithinPlatformApp(frame)) | 802 if (IsWithinPlatformApp(frame)) |
803 module_system->Require("platformApp"); | 803 module_system->Require("platformApp"); |
804 | 804 |
805 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && | 805 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && |
| 806 (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebView) || |
| 807 (CommandLine::ForCurrentProcess()->HasSwitch( |
| 808 switches::kEnableBrowserPluginForAllViewTypes))) && |
806 extension->HasAPIPermission(APIPermission::kWebView)) { | 809 extension->HasAPIPermission(APIPermission::kWebView)) { |
807 module_system->Require("webview"); | 810 module_system->Require("webview"); |
808 } | 811 } |
809 | 812 |
810 context->set_module_system(module_system.Pass()); | 813 context->set_module_system(module_system.Pass()); |
811 | 814 |
812 context->DispatchOnLoadEvent( | 815 context->DispatchOnLoadEvent( |
813 ChromeRenderProcessObserver::is_incognito_process(), | 816 ChromeRenderProcessObserver::is_incognito_process(), |
814 manifest_version); | 817 manifest_version); |
815 | 818 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 // we should abort. | 1122 // we should abort. |
1120 WebKit::WebFrame* frame = context->web_frame(); | 1123 WebKit::WebFrame* frame = context->web_frame(); |
1121 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1124 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
1122 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1125 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
1123 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1126 CHECK(!extensions_.IsSandboxedPage(url_info)); |
1124 | 1127 |
1125 return true; | 1128 return true; |
1126 } | 1129 } |
1127 | 1130 |
1128 } // namespace extensions | 1131 } // namespace extensions |
OLD | NEW |