Chromium Code Reviews| 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/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && | 1108 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && |
| 1109 is_within_platform_app && | 1109 is_within_platform_app && |
| 1110 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && | 1110 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && |
| 1111 CommandLine::ForCurrentProcess()->HasSwitch( | 1111 CommandLine::ForCurrentProcess()->HasSwitch( |
| 1112 switches::kEnableAppWindowControls)) { | 1112 switches::kEnableAppWindowControls)) { |
| 1113 module_system->Require("windowControls"); | 1113 module_system->Require("windowControls"); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1116 // Currently only platform apps and whitelisted component extensions support |
| 1117 // the <webview> tag, because the "denyWebView" module will affect the | |
| 1118 // performance of DOM modifications (http://crbug.com/196453). | |
| 1119 // We used to limit WebView to |BLESSED_EXTENSION_CONTEXT| within platform | |
| 1120 // apps. An ext/app runs in a blessed extension context, if it is the active | |
| 1121 // extension in the current process, in other words, if it is loaded in the | |
|
not at google - send to devlin
2013/09/25 17:14:03
FWIW the comment is slightly misleading since ther
guohui
2013/09/25 22:43:51
Done.
| |
| 1122 // top frame. To support webview in an iframed extension, we have to allow | |
|
not at google - send to devlin
2013/09/25 17:14:03
note that this would include other non toplevel fr
guohui
2013/09/25 22:43:51
Done.
| |
| 1123 // unblessed extension context as well. | |
| 1124 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT || | |
| 1125 context_type == Feature::UNBLESSED_EXTENSION_CONTEXT) { | |
| 1117 // Note: setting up the WebView class here, not the chrome.webview API. | 1126 // Note: setting up the WebView class here, not the chrome.webview API. |
| 1118 // The API will be automatically set up when first used. | 1127 // The API will be automatically set up when first used. |
| 1119 if (extension->HasAPIPermission(APIPermission::kWebView)) { | 1128 if (extension->HasAPIPermission(APIPermission::kWebView)) { |
| 1120 module_system->Require("webView"); | 1129 module_system->Require("webView"); |
| 1121 // TODO(mtomasz): Remove the Files app from the whitelist in M-31. | 1130 // TODO(mtomasz): Remove the Files app from the whitelist in M-31. |
| 1122 // crbug.com/297936 | 1131 // crbug.com/297936 |
| 1123 bool includeExperimental = | 1132 bool includeExperimental = |
| 1124 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || | 1133 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || |
| 1125 extension->id() == extension_misc::kIdentityApiUiAppId || | 1134 extension->id() == extension_misc::kIdentityApiUiAppId || |
| 1126 extension->id() == "hhaomjibdihmijegdhdafkllkbggdgoj"; // Files App. | 1135 extension->id() == "hhaomjibdihmijegdhdafkllkbggdgoj"; // Files App. |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1561 RenderView* background_view = | 1570 RenderView* background_view = |
| 1562 ExtensionHelper::GetBackgroundPage(extension_id); | 1571 ExtensionHelper::GetBackgroundPage(extension_id); |
| 1563 if (background_view) { | 1572 if (background_view) { |
| 1564 background_view->Send(new ExtensionHostMsg_EventAck( | 1573 background_view->Send(new ExtensionHostMsg_EventAck( |
| 1565 background_view->GetRoutingID())); | 1574 background_view->GetRoutingID())); |
| 1566 } | 1575 } |
| 1567 } | 1576 } |
| 1568 } | 1577 } |
| 1569 | 1578 |
| 1570 } // namespace extensions | 1579 } // namespace extensions |
| OLD | NEW |