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

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

Issue 657023008: Add a new field "source" in launchData of chrome.app.runtime.onLaunched() to trace launch source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: extensions/renderer/resources/app_runtime_custom_bindings.js
diff --git a/extensions/renderer/resources/app_runtime_custom_bindings.js b/extensions/renderer/resources/app_runtime_custom_bindings.js
index 267ba0931fad9d4f164ac54d70f0d4dd58e18767..e14e1800b45926889563f5b43d8bb0e07d0be9b1 100644
--- a/extensions/renderer/resources/app_runtime_custom_bindings.js
+++ b/extensions/renderer/resources/app_runtime_custom_bindings.js
@@ -47,19 +47,23 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched',
$Array.push(items, item);
}
if (--numItems === 0) {
- var data = { isKioskSession: launchData.isKioskSession };
- if (items.length !== 0) {
- data.id = launchData.id;
- data.items = items;
+ if (items.length == 0) {
+ delete launchData.id;
+ delete launchData.items;
benwells 2014/10/28 21:22:48 Why is this changing?
cylee1 2014/10/29 16:40:00 The behavior is not changed - if "items" is empty,
benwells 2014/10/30 06:04:28 I think I see what you're trying to do. I'd prefer
+ } else {
+ launchData.items = items;
}
- dispatch([data]);
+ dispatch([launchData]);
}
};
$Array.forEach(launchData.items, function(item) {
- var fs = GetIsolatedFileSystem(item.fileSystemId);
- fs.root.getFile(item.baseName, {}, function(fileEntry) {
- entryIdManager.registerEntry(item.entryId, fileEntry);
- itemLoaded(null, { entry: fileEntry, type: item.mimeType });
+ var rawEntry = item.rawEntry;
+ delete item.rawEntry;
+ var fs = GetIsolatedFileSystem(rawEntry.fileSystemId);
+ fs.root.getFile(rawEntry.baseName, {}, function(fileEntry) {
+ entryIdManager.registerEntry(rawEntry.entryId, fileEntry);
+ item.entry = fileEntry;
benwells 2014/10/28 21:22:48 Again, why is this changing?
cylee1 2014/10/29 16:40:00 Explained above. It's only a re-implementation and
+ itemLoaded(null, item);
}, function(fileError) {
itemLoaded(fileError);
});

Powered by Google App Engine
This is Rietveld 408576698