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..17e1e36671351cc1463e635a9e1993c9bc59b5ab 100644 |
--- a/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/app_runtime_custom_bindings.js |
@@ -19,8 +19,14 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched', |
function(args, dispatch) { |
var launchData = args[0]; |
- if (launchData && typeof launchData.id !== 'undefined') { |
- // new-style dispatch. |
+ if (!launchData) { |
+ dispatch([]); |
not at google - send to devlin
2013/09/03 18:28:04
for consistency with the other comments should you
sergeygs
2013/09/04 03:29:17
Done.
|
+ return; |
+ } |
+ |
+ if (launchData.items) { |
+ // An onLaunched corresponding to file_handlers in the app's manifest. |
+ // NOTE: Using the new-style dispatch. |
not at google - send to devlin
2013/09/03 18:28:04
this NOTE doesn't add anything.
sergeygs
2013/09/04 03:29:17
I wasn't the one who added it initially, so I didn
|
var items = [] |
var numItems = launchData.items.length; |
var itemLoaded = function(err, item) { |
@@ -47,10 +53,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]); |
} |
}); |