Chromium Code Reviews| 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..cb6c713307c18b7d7df5d9efb7a56b79c3a22f67 100644 |
| --- a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
| @@ -19,8 +19,16 @@ 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. |
| + // NOTE: Using the new-style dispatch. |
|
benwells
2013/09/04 23:54:20
To answer the earlier comment: I have no idea what
sergeygs
2013/09/05 09:19:03
Done.
|
| var items = [] |
| var numItems = launchData.items.length; |
| var itemLoaded = function(err, item) { |
| @@ -47,10 +55,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]); |
| } |
| }); |