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

Unified Diff: extensions/renderer/resources/app_window_custom_bindings.js

Issue 1107163002: Sandbox windows not provided to chrome.app.window.create. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/common/extensions/docs/templates/articles/app_external.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/app_window_custom_bindings.js
diff --git a/extensions/renderer/resources/app_window_custom_bindings.js b/extensions/renderer/resources/app_window_custom_bindings.js
index 99c1a3d66b7481ae4629bcbdaa8dec8d92807785..e182db73250dcd77be0229cb33ce69aac3aca5b3 100644
--- a/extensions/renderer/resources/app_window_custom_bindings.js
+++ b/extensions/renderer/resources/app_window_custom_bindings.js
@@ -140,10 +140,21 @@ appWindow.registerCustomHook(function(bindingsAPI) {
}
// Initialize appWindowData in the newly created JS context
- view.chrome.app.window.initializeAppWindow(windowParams);
+ if (view.chrome.app) {
+ view.chrome.app.window.initializeAppWindow(windowParams);
+ } else {
+ var sandbox_window_message = 'Creating sandboxed window, it doesn\'t ' +
+ 'have access to the chrome.app API.';
+ if (callback) {
+ sandbox_window_message = sandbox_window_message +
+ ' The chrome.app.window.create callback will be called, but ' +
+ 'there will be no object provided for the sandboxed window.';
+ }
+ console.warn(sandbox_window_message);
+ }
if (callback) {
- if (!view) {
+ if (!view || !view.chrome.app /* sandboxed window */) {
callback(undefined);
return;
}
« no previous file with comments | « chrome/common/extensions/docs/templates/articles/app_external.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698