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

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

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review comments + lint errors Created 7 years, 4 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 0f3a0f784daa5cc6874c6d2ae5c3b2a72a5fb9d7..075ac31e3fd7db25d17590b4b4e3f002aa1ffdbd 100644
--- a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js
@@ -52,8 +52,14 @@ chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched',
function(args, dispatch) {
var launchData = args[0];
- if (launchData && typeof launchData.id !== 'undefined') {
- // new-style dispatch.
+ if (!launchData) {
+ dispatch([]);
+ return;
+ }
+
+ if (launchData.items) {
+ // An onLaunched corresponding to file_handlers in the app's manifest.
+ // NOTE: Using the new-style dispatch.
var items = []
var numItems = launchData.items.length;
var itemLoaded = function(err, item) {
@@ -79,10 +85,10 @@ chromeHidden.Event.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