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

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: Addressed Istiaque's comments Created 6 years, 5 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];
« extensions/common/api/app_runtime.idl ('K') | « extensions/common/api/app_runtime.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698