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

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

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Limit interception to http:// and https:// Created 7 years, 3 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: chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
index 0411d32164d29cb475e7964eededf0c3c1174ae6..b6af67fa93629009e2541dddd81dea1ecf91791e 100644
--- a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
@@ -19,8 +19,15 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched',
function(args, dispatch) {
var launchData = args[0];
- if (launchData && typeof launchData.id !== 'undefined') {
- // new-style dispatch.
+ if (!launchData) {
+ // An onLaunched corresponding to launching directly or from
+ // the app launcher or browser.
+ dispatch([]);
+ return;
+ }
+
+ if (launchData.items) {
+ // An onLaunched corresponding to file_handlers in the app's manifest.
var items = []
var numItems = launchData.items.length;
var itemLoaded = function(err, item) {
@@ -47,10 +54,10 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched',
itemLoaded(fileError);
});
});
- } else if (launchData) {
- dispatch([launchData]);
} else {
- dispatch([]);
+ // Default case. This currently covers an onLaunched corresponding to
+ // url_handlers in the app's manifest.
+ dispatch([launchData]);
}
});

Powered by Google App Engine
This is Rietveld 408576698