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

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

Issue 512543002: Model <webview> and <appview> script injection after <extensionoptions> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed kalman@'s comments Created 6 years, 4 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
Index: chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
index ccbff5e6d5a12a416987da0408a3fdddb8cfc69c..580d2f2377d40cde6a7964ad5fedd2396e309f7c 100644
--- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
+++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
@@ -272,51 +272,25 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
module_system->Require("windowControls");
}
- const extensions::Extension* extension = context->extension();
-
- // We used to limit WebView to |BLESSED_EXTENSION_CONTEXT| within platform
- // apps. An ext/app runs in a blessed extension context, if it is the active
- // extension in the current process, in other words, if it is loaded in a top
- // frame. To support webview in a non-frame extension, we have to allow
- // unblessed extension context as well.
// Note: setting up the WebView class here, not the chrome.webview API.
// The API will be automatically set up when first used.
- if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT ||
- context_type == extensions::Feature::UNBLESSED_EXTENSION_CONTEXT) {
- // TODO(fsamuel): Use context->GetAvailability("webViewInternal").
- if (extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kWebView)) {
- module_system->Require("webView");
- if (extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV) {
- module_system->Require("webViewExperimental");
- } else {
- // TODO(asargent) We need a whitelist for webview experimental.
- // crbug.com/264852
- std::string id_hash = base::SHA1HashString(extension->id());
- std::string hexencoded_id_hash =
- base::HexEncode(id_hash.c_str(), id_hash.length());
- if (hexencoded_id_hash == "8C3741E3AF0B93B6E8E0DDD499BB0B74839EA578" ||
- hexencoded_id_hash == "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" ||
- hexencoded_id_hash == "1A26E32DE447A17CBE5E9750CDBA78F58539B39C" ||
- hexencoded_id_hash == "59048028102D7B4C681DBC7BC6CD980C3DC66DA3") {
- module_system->Require("webViewExperimental");
- }
- }
- } else {
+ if (context->GetAvailability("webViewInternal").is_available()) {
+ module_system->Require("webView");
+ if (context->GetAvailability("webViewExperimentalInternal").is_available())
+ module_system->Require("webViewExperimental");
+ } else {
not at google - send to devlin 2014/08/27 01:15:59 why not "} else if {"?
Fady Samuel 2014/08/27 01:33:36 Done.
+ if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT ||
+ context_type == extensions::Feature::UNBLESSED_EXTENSION_CONTEXT) {
not at google - send to devlin 2014/08/27 01:15:59 I was thinking about this - it's probably enough t
Fady Samuel 2014/08/27 01:33:36 Done.
module_system->Require("denyWebView");
}
}
- if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) {
- // TODO(fsamuel): Use context->GetAvailability("appViewInternal").
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- extensions::switches::kEnableAppView) &&
- extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kAppView)) {
- module_system->Require("appView");
- } else {
+ if (extensions::FeatureSwitch::app_view()->IsEnabled() &&
+ context->GetAvailability("appViewEmbedderInternal").is_available()) {
+ module_system->Require("appView");
+ } else {
not at google - send to devlin 2014/08/27 01:15:59 Likewise: "} else if {" ?
Fady Samuel 2014/08/27 01:33:36 Done.
+ if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT)
not at google - send to devlin 2014/08/27 01:15:59 Sheesh I wish this file was in the extensions name
Fady Samuel 2014/08/27 01:33:36 This code is moving into extensions soon.
module_system->Require("denyAppView");
- }
}
if (extensions::FeatureSwitch::embedded_extension_options()->IsEnabled() &&

Powered by Google App Engine
This is Rietveld 408576698