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..b34296e6a96ede664e888f15058d1bd9abf21b05 100644 |
--- a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
@@ -52,8 +52,15 @@ 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. |
+ // Need to do some special processin for this case. |
not at google - send to devlin
2013/08/29 17:35:56
processing
but this is kind of vague and so eithe
sergeygs
2013/08/30 00:39:44
Done. Removed :) Also moved the default case into
|
+ // NOTE: Using the new-style dispatch. |
var items = [] |
var numItems = launchData.items.length; |
var itemLoaded = function(err, item) { |
@@ -79,11 +86,12 @@ chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', |
itemLoaded(fileError); |
}); |
}); |
- } else if (launchData) { |
- dispatch([launchData]); |
- } else { |
- dispatch([]); |
+ return; |
} |
+ |
+ // Default case. This currently covers an onLaunched corresponding to |
+ // url_handlers in the app's manifest. |
+ dispatch([launchData]); |
}); |
exports.binding = binding.generate(); |