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

Unified Diff: ui/file_manager/image_loader/image_loader.js

Issue 985533004: Implement chrome.fileSystem.requestFileSystem(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile issues. Created 5 years, 9 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: 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.

Powered by Google App Engine
This is Rietveld 408576698