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..267ba0931fad9d4f164ac54d70f0d4dd58e18767 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.onEmbedRequested', |
+ function(args, dispatch) { |
+ var appEmbeddingRequest = args[0]; |
+ var id = appEmbeddingRequest.guestInstanceId; |
+ delete appEmbeddingRequest.guestInstanceId; |
+ appEmbeddingRequest.allow = function(url) { |
+ AppViewInternal.attachFrame(url, id); |
+ }; |
+ |
+ appEmbeddingRequest.deny = function() { |
+ AppViewInternal.denyRequest(id); |
+ }; |
+ |
+ dispatch([appEmbeddingRequest]); |
+}); |
+ |
eventBindings.registerArgumentMassager('app.runtime.onLaunched', |
function(args, dispatch) { |
var launchData = args[0]; |