Chromium Code Reviews| Index: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js |
| diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js |
| index 13edd5f6f45ab2c948d5411f1f7fdc101883b1e1..c9d0f6473be2d2cf06a3aa0ee9a059e39ccf612d 100644 |
| --- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js |
| +++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js |
| @@ -38,11 +38,11 @@ function FileTransferController(doc, |
| this.directoryModel_.getFileList().addEventListener( |
| 'change', function(event) { |
|
yoshiki
2014/09/16 00:49:08
nit: new line for function?
fukino
2014/09/17 05:17:26
Done.
|
| - if (this.directoryModel_.getFileListSelection(). |
| - getIndexSelected(event.index)) { |
| - this.onSelectionChanged_(); |
| - } |
| - }.bind(this)); |
| + if (this.directoryModel_.getFileListSelection(). |
| + getIndexSelected(event.index)) { |
| + this.onSelectionChanged_(); |
| + } |
| + }.bind(this)); |
| this.directoryModel_.getFileListSelection().addEventListener('change', |
| this.onSelectionChanged_.bind(this)); |
| @@ -266,8 +266,7 @@ FileTransferController.prototype = { |
| // crbug.com/345527. |
| var urls = util.entriesToURLs(entries); |
| chrome.fileManagerPrivate.getEntryProperties(urls, callback); |
| - }). |
| - then(function(metadatas) { |
| + }).then(function(metadatas) { |
| return entries.filter(function(entry, i) { |
| var metadata = metadatas[i]; |
| return metadata && metadata.isHosted && !metadata.sharedWithMe; |
| @@ -334,14 +333,12 @@ FileTransferController.prototype = { |
| var entries; |
| var failureUrls; |
| - util.URLsToEntries(sourceURLs). |
| - then(function(result) { |
| + util.URLsToEntries(sourceURLs).then(function(result) { |
| entries = result.entries; |
| failureUrls = result.failureUrls; |
| // Check if cross share is needed or not. |
| return this.getMultiProfileShareEntries_(entries); |
| - }.bind(this)). |
| - then(function(shareEntries) { |
| + }.bind(this)).then(function(shareEntries) { |
| if (shareEntries.length === 0) |
| return; |
| return this.multiProfileShareDialog_.show(shareEntries.length > 1). |
| @@ -365,8 +362,7 @@ FileTransferController.prototype = { |
| }; |
| return requestDriveShare(0); |
| }); |
| - }.bind(this)). |
| - then(function() { |
| + }.bind(this)).then(function() { |
| // Start the pasting operation. |
| this.fileOperationManager_.paste( |
| entries, destinationEntry, toMove); |
| @@ -381,8 +377,7 @@ FileTransferController.prototype = { |
| toMove ? ProgressItemType.MOVE : ProgressItemType.COPY; |
| this.dispatchEvent(event); |
| } |
| - }.bind(this)). |
| - catch(function(error) { |
| + }.bind(this)).catch(function(error) { |
| if (error !== 'ABORT') |
| console.error(error.stack ? error.stack : error); |
| }); |
| @@ -397,14 +392,13 @@ FileTransferController.prototype = { |
| */ |
| preloadThumbnailImage_: function(entry) { |
| var metadataPromise = new Promise(function(fulfill, reject) { |
| - this.metadataCache_.getOne(entry, |
| - 'thumbnail|filesystem', |
| - function(metadata) { |
| - if (metadata) |
| - fulfill(metadata); |
| - else |
| - reject('Failed to fetch metadata.'); |
| - }); |
| + this.metadataCache_.getOne( |
| + entry, 'thumbnail|filesystem', function(metadata) { |
|
yoshiki
2014/09/16 00:49:08
nit: new line for function?
fukino
2014/09/17 05:17:26
Done.
|
| + if (metadata) |
| + fulfill(metadata); |
| + else |
| + reject('Failed to fetch metadata.'); |
| + }); |
| }.bind(this)); |
| var imagePromise = metadataPromise.then(function(metadata) { |
| @@ -538,7 +532,7 @@ FileTransferController.prototype = { |
| window[DRAG_AND_DROP_GLOBAL_DATA] = { |
| sourceRootURL: dt.getData('fs/sourceRootURL'), |
| - missingFileContents: dt.getData('fs/missingFileContents'), |
| + missingFileContents: dt.getData('fs/missingFileContents') |
| }; |
| }, |