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

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

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Added tests 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
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];

Powered by Google App Engine
This is Rietveld 408576698