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

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: Fixed formatting 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
« no previous file with comments | « extensions/extensions.gyp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « extensions/extensions.gyp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698