diff options
Diffstat (limited to 'chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js')
-rw-r--r-- | chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js b/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js index 9d374ae..7347e23 100644 --- a/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js +++ b/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js @@ -24,34 +24,32 @@ binding.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; apiFunctions.setCustomCallback('requestFileSystem', - function(name, request, response) { + function(name, request, callback, response) { var fs = null; if (response && !response.error) fs = GetFileSystem(response.name, response.root_url); - if (request.callback) - request.callback(fs); - request.callback = null; + if (callback) + callback(fs); }); apiFunctions.setCustomCallback('searchDrive', - function(name, request, response) { + function(name, request, callback, response) { if (response && !response.error && response.entries) { response.entries = response.entries.map(function(entry) { return GetExternalFileEntry(entry); }); } - // So |request.callback| doesn't break if response is not defined. + // So |callback| doesn't break if response is not defined. if (!response) response = {}; - if (request.callback) - request.callback(response.entries, response.nextFeed); - request.callback = null; + if (callback) + callback(response.entries, response.nextFeed); }); apiFunctions.setCustomCallback('searchDriveMetadata', - function(name, request, response) { + function(name, request, callback, response) { if (response && !response.error) { for (var i = 0; i < response.length; i++) { response[i].entry = @@ -59,13 +57,12 @@ binding.registerCustomHook(function(bindingsAPI) { } } - // So |request.callback| doesn't break if response is not defined. + // So |callback| doesn't break if response is not defined. if (!response) response = {}; - if (request.callback) - request.callback(response); - request.callback = null; + if (callback) + callback(response); }); apiFunctions.setHandleRequest('resolveIsolatedEntries', |