| 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([]);
|
| }
|
| });
|
|
|
|
|