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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && | 1109 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && |
| 1110 is_within_platform_app && | 1110 is_within_platform_app && |
| 1111 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && | 1111 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && |
| 1112 CommandLine::ForCurrentProcess()->HasSwitch( | 1112 CommandLine::ForCurrentProcess()->HasSwitch( |
| 1113 switches::kEnableAppWindowControls)) { | 1113 switches::kEnableAppWindowControls)) { |
| 1114 module_system->Require("windowControls"); | 1114 module_system->Require("windowControls"); |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 // Only platform apps support the <webview> tag, because the "webView" and | 1117 // Currently only platform apps and whitelisted component extensions support |
| 1118 // "denyWebView" modules will affect the performance of DOM modifications | 1118 // the <webview> tag, because the "denyWebView" modules will affect the |
|
Fady Samuel
2013/09/19 19:52:14
s/modules/module.
guohui1
2013/09/19 20:04:48
Done.
| |
| 1119 // (http://crbug.com/196453). | 1119 // performance of DOM modifications (http://crbug.com/196453). |
| 1120 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT && | 1120 // We used to limit WebView to |BLESSED_EXTENSION_CONTEXT| within platform |
| 1121 is_within_platform_app) { | 1121 // apps. An ext/app runs in a blessed extension context, if it is the active |
| 1122 // extension in the current process, in other words, if it is loaded in the | |
| 1123 // top frame. To support webview in an iframed extension, we have to allow | |
| 1124 // unblessed extension context as well. | |
| 1125 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT || | |
| 1126 context_type == Feature::UNBLESSED_EXTENSION_CONTEXT) { | |
| 1122 // Note: setting up the WebView class here, not the chrome.webview API. | 1127 // Note: setting up the WebView class here, not the chrome.webview API. |
| 1123 // The API will be automatically set up when first used. | 1128 // The API will be automatically set up when first used. |
| 1124 if (extension->HasAPIPermission(APIPermission::kWebView)) { | 1129 if (extension->HasAPIPermission(APIPermission::kWebView)) { |
| 1125 module_system->Require("webView"); | 1130 module_system->Require("webView"); |
| 1126 bool includeExperimental = | 1131 bool includeExperimental = |
| 1127 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || | 1132 GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV || |
| 1128 extension->id() == extension_misc::kIdentityApiUiAppId; | 1133 extension->id() == extension_misc::kIdentityApiUiAppId; |
| 1129 if (!includeExperimental) { | 1134 if (!includeExperimental) { |
| 1130 // TODO(asargent) We need a whitelist for webview experimental. | 1135 // TODO(asargent) We need a whitelist for webview experimental. |
| 1131 // crbug.com/264852 | 1136 // crbug.com/264852 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1569 RenderView* background_view = | 1574 RenderView* background_view = |
| 1570 ExtensionHelper::GetBackgroundPage(extension_id); | 1575 ExtensionHelper::GetBackgroundPage(extension_id); |
| 1571 if (background_view) { | 1576 if (background_view) { |
| 1572 background_view->Send(new ExtensionHostMsg_EventAck( | 1577 background_view->Send(new ExtensionHostMsg_EventAck( |
| 1573 background_view->GetRoutingID())); | 1578 background_view->GetRoutingID())); |
| 1574 } | 1579 } |
| 1575 } | 1580 } |
| 1576 } | 1581 } |
| 1577 | 1582 |
| 1578 } // namespace extensions | 1583 } // namespace extensions |
| OLD | NEW |