Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 12496015: Make sure only platform app support <webview> tag (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Set is_within_platform_app to IsWithinPlatformApp(frame) Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 887a26df22a8931c14243bb13e37ebe5eeeae364..e6c06a64272d60b68b2d4350b0ea72f8d2ac82ff 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -977,11 +977,16 @@ void Dispatcher::DidCreateScriptContext(
}
}
+ bool is_within_platform_app = IsWithinPlatformApp(frame);
// Inject custom JS into the platform app context.
- if (IsWithinPlatformApp(frame))
+ if (is_within_platform_app)
module_system->Require("platformApp");
- if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
+ // Only platform apps support the <webview> tag, because the "webView" and
+ // "denyWebView" modules will affect the performance of DOM modifications
+ // (http://crbug.com/196453).
+ if (context_type == Feature::BLESSED_EXTENSION_CONTEXT &&
+ is_within_platform_app) {
// Note: setting up the WebView class here, not the chrome.webview API.
// The API will be automatically set up when first used.
if (extension->HasAPIPermission(APIPermission::kWebView)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698