Index: extensions/renderer/resources/app_runtime_custom_bindings.js |
diff --git a/extensions/renderer/resources/app_runtime_custom_bindings.js b/extensions/renderer/resources/app_runtime_custom_bindings.js |
index f4fe24dbb67e216f91b27eeaee69b666530e099a..8d35f36fc5146fba93c6b52aec8c4082e078c9d2 100644 |
--- a/extensions/renderer/resources/app_runtime_custom_bindings.js |
+++ b/extensions/renderer/resources/app_runtime_custom_bindings.js |
@@ -6,6 +6,8 @@ |
var binding = require('binding').Binding.create('app.runtime'); |
+var AppViewInternal = |
+ require('binding').Binding.create('appViewInternal').generate(); |
var eventBindings = require('event_bindings'); |
var fileSystemHelpers = requireNative('file_system_natives'); |
var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; |
@@ -15,6 +17,22 @@ var SerializeToString = appNatives.SerializeToString; |
var CreateBlob = appNatives.CreateBlob; |
var entryIdManager = require('entryIdManager'); |
+eventBindings.registerArgumentMassager('app.runtime.onAppEmbeddingRequest', |
+ function(args, dispatch) { |
+ var appEmbeddingRequest = args[0]; |
+ var id = appEmbeddingRequest.guestInstanceId; |
+ delete appEmbeddingRequest.guestInstanceId; |
+ appEmbeddingRequest.allow = function(url, api, schema) { |
+ AppViewInternal.attachFrame(url, id); |
+ }; |
+ |
+ appEmbeddingRequest.deny = function() { |
+ AppViewInternal.denyRequest(id); |
+ }; |
+ |
+ dispatch([appEmbeddingRequest]); |
+}); |
+ |
eventBindings.registerArgumentMassager('app.runtime.onLaunched', |
function(args, dispatch) { |
var launchData = args[0]; |