| 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..a723ad61353a65e9282d6db535933cab9c740928 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') {
|
| + 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.
|
|
|