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

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

Issue 23597024: Revert 222257 "Revert 222235 ""Redirecting URLs to Packaged Apps..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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: trunk/src/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
===================================================================
--- trunk/src/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js (revision 222257)
+++ trunk/src/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js (working copy)
@@ -19,8 +19,15 @@
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 @@
itemLoaded(fileError);
});
});
- } else if (launchData) {
+ } else {
+ // Default case. This currently covers an onLaunched corresponding to
+ // url_handlers in the app's manifest.
dispatch([launchData]);
- } else {
- dispatch([]);
}
});

Powered by Google App Engine
This is Rietveld 408576698