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

Unified Diff: chrome/renderer/resources/event_bindings.js

Issue 6749021: Added new fileBrowserPrivate and fileHandler extension APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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: chrome/renderer/resources/event_bindings.js
===================================================================
--- chrome/renderer/resources/event_bindings.js (revision 81868)
+++ chrome/renderer/resources/event_bindings.js (working copy)
@@ -7,6 +7,7 @@
native function GetChromeHidden();
native function AttachEvent(eventName);
native function DetachEvent(eventName);
+ native function GetExternalFileEntry(fileDefinition);
var chromeHidden = GetChromeHidden();
@@ -88,6 +89,18 @@
if (attachedNamedEvents[name]) {
if (args) {
args = chromeHidden.JSON.parse(args);
+ // TODO(zelidrag|aa): Remove this hack from here once we enable event
+ // JSON payload unpacking on C++ side.
+ if (name == "fileBrowserHandler.onExecute") {
+ if (args.length != 2)
+ return;
+ var fileList = args[1];
+ // The second parameter for this event's payload is file definition
+ // dictionary that we used to reconstruct File API's Entry instance
+ // here.
+ for (var i = 0; i < fileList.length; i++)
+ args[1][i] = GetExternalFileEntry(fileList[i]);
+ }
}
return attachedNamedEvents[name].dispatch.apply(
attachedNamedEvents[name], args);
« no previous file with comments | « chrome/renderer/extensions/event_bindings.cc ('k') | chrome/renderer/resources/renderer_extension_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698