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

Side by Side Diff: chrome/renderer/extensions/dispatcher.cc

Issue 24243007: Allow webview API in an unblessed extension process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed style error Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 a top
1122 // frame. To support webview in a non-frame extension, we have to allow
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 RenderView* background_view = 1568 RenderView* background_view =
1560 ExtensionHelper::GetBackgroundPage(extension_id); 1569 ExtensionHelper::GetBackgroundPage(extension_id);
1561 if (background_view) { 1570 if (background_view) {
1562 background_view->Send(new ExtensionHostMsg_EventAck( 1571 background_view->Send(new ExtensionHostMsg_EventAck(
1563 background_view->GetRoutingID())); 1572 background_view->GetRoutingID()));
1564 } 1573 }
1565 } 1574 }
1566 } 1575 }
1567 1576
1568 } // namespace extensions 1577 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | content/browser/browser_plugin/browser_plugin_guest_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698