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

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

Issue 353013007: Implement <appview> skeleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Fixed PermissionsTest unit test Created 6 years, 6 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 | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/extensions/app_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 08bc023906c2e53f5ed4ff9d4f86935f8492bb09..13276e262eb5b7aaa7aaa05d0ac482b5bd696103 100644
--- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
+++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
@@ -235,6 +235,7 @@ void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
IDR_CHROME_DIRECT_SETTING_JS);
// Platform app sources that are not API-specific..
+ source_map->RegisterSource("appView", IDR_APP_VIEW_JS);
source_map->RegisterSource("tagWatcher", IDR_TAG_WATCHER_JS);
source_map->RegisterSource("webViewInternal",
IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS);
@@ -246,6 +247,7 @@ void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
IDR_WEB_VIEW_EXPERIMENTAL_JS);
source_map->RegisterSource("webViewRequest",
IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS);
+ source_map->RegisterSource("denyAppView", IDR_APP_VIEW_DENY_JS);
source_map->RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS);
source_map->RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS);
}
@@ -255,6 +257,9 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
const extensions::Extension* extension,
extensions::Feature::Context context_type,
bool is_within_platform_app) {
+ // TODO(kalman, fsamuel): Eagerly calling Require on context startup is
+ // expensive. It would be better if there were a light way of detecting when
+ // a webview or appview is created and only then set up the infrastructure.
if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT &&
is_within_platform_app &&
extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
@@ -294,6 +299,16 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
module_system->Require("denyWebView");
}
}
+
+ if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppView) &&
+ extension->permissions_data()->HasAPIPermission(
+ extensions::APIPermission::kAppView)) {
+ module_system->Require("appView");
+ } else {
+ module_system->Require("denyAppView");
+ }
+ }
}
void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated(
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/extensions/app_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698