Chromium Code Reviews| Index: ui/file_manager/image_loader/image_loader.js |
| diff --git a/ui/file_manager/image_loader/image_loader.js b/ui/file_manager/image_loader/image_loader.js |
| index abd183d45731ea0ce14934933a7ae4ec3c0a1cf2..baa8d56db15ca85a02af7210765c1dc696744fa8 100644 |
| --- a/ui/file_manager/image_loader/image_loader.js |
| +++ b/ui/file_manager/image_loader/image_loader.js |
| @@ -24,10 +24,18 @@ function ImageLoader() { |
| // Grant permissions to all volumes, initialize the cache and then start the |
| // scheduler. |
| chrome.fileManagerPrivate.getVolumeMetadataList(function(volumeMetadataList) { |
| + // Listen for mount events, and grant permissions to volumes being mounted. |
| + chrome.fileManagerPrivate.onMountCompleted.addListener( |
| + function(event) { |
| + if (event.eventType == 'mount' && event.status == 'success') { |
|
hirono
2015/03/19 03:33:54
nit: === are preferred.
mtomasz
2015/03/19 10:28:41
Done.
|
| + chrome.fileSystem.requestFileSystem( |
| + {volumeId: event.volumeMetadata.volumeId}, function() {}); |
| + } |
| + }); |
| var initPromises = volumeMetadataList.map(function(volumeMetadata) { |
| var requestPromise = new Promise(function(callback) { |
| - chrome.fileManagerPrivate.requestFileSystem( |
| - volumeMetadata.volumeId, |
| + chrome.fileSystem.requestFileSystem( |
| + {volumeId: volumeMetadata.volumeId}, |
| callback); |
| }); |
| return requestPromise; |
| @@ -38,15 +46,6 @@ function ImageLoader() { |
| // After all initialization promises are done, start the scheduler. |
| Promise.all(initPromises).then(this.scheduler_.start.bind(this.scheduler_)); |
| - |
| - // Listen for mount events, and grant permissions to volumes being mounted. |
| - chrome.fileManagerPrivate.onMountCompleted.addListener( |
| - function(event) { |
| - if (event.eventType == 'mount' && event.status == 'success') { |
| - chrome.fileManagerPrivate.requestFileSystem( |
| - event.volumeMetadata.volumeId, function() {}); |
| - } |
| - }); |
| }.bind(this)); |
| // Listen for incoming requests. |