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

Side by Side Diff: chrome/browser/resources/file_manager/js/volume_manager.js

Issue 12978002: Keep the 'fetching files' message until the Drive root is ready to be read. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * VolumeManager is responsible for tracking list of mounted volumes. 6 * VolumeManager is responsible for tracking list of mounted volumes.
7 * 7 *
8 * @constructor 8 * @constructor
9 * @extends {cr.EventTarget} 9 * @extends {cr.EventTarget}
10 */ 10 */
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 * drive ready to operate. 246 * drive ready to operate.
247 * 247 *
248 * @param {string} mountPath Drive mount path. 248 * @param {string} mountPath Drive mount path.
249 * @param {function(boolean, FileError=)} callback To be called when waiting 249 * @param {function(boolean, FileError=)} callback To be called when waiting
250 * finishes. If the case of error, there may be a FileError parameter. 250 * finishes. If the case of error, there may be a FileError parameter.
251 * @private 251 * @private
252 */ 252 */
253 VolumeManager.prototype.waitDriveLoaded_ = function(mountPath, callback) { 253 VolumeManager.prototype.waitDriveLoaded_ = function(mountPath, callback) {
254 chrome.fileBrowserPrivate.requestLocalFileSystem(function(filesystem) { 254 chrome.fileBrowserPrivate.requestLocalFileSystem(function(filesystem) {
255 filesystem.root.getDirectory(mountPath, {}, 255 filesystem.root.getDirectory(mountPath, {},
256 callback.bind(null, true), 256 function(entry) {
257 // After introducion of the 'fast-fetch' feature, getting the root
258 // entry does not start fetching data. Rather, it starts when the
259 // entry is read.
260 entry.createReader().readEntries(
261 callback.bind(null, true),
262 callback.bind(null, false));
263 },
257 callback.bind(null, false)); 264 callback.bind(null, false));
258 }); 265 });
259 }; 266 };
260 267
261 /** 268 /**
262 * @param {string} mountPath Path to the volume. 269 * @param {string} mountPath Path to the volume.
263 * @param {VolumeManager?} error Mounting error if any. 270 * @param {VolumeManager?} error Mounting error if any.
264 * @param {function(Object)} callback Result acceptor. 271 * @param {function(Object)} callback Result acceptor.
265 * @private 272 * @private
266 */ 273 */
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 /** 525 /**
519 * @param {string} mountPath Mount path. 526 * @param {string} mountPath Mount path.
520 * @private 527 * @private
521 */ 528 */
522 VolumeManager.prototype.validateMountPath_ = function(mountPath) { 529 VolumeManager.prototype.validateMountPath_ = function(mountPath) {
523 console.log(mountPath); 530 console.log(mountPath);
524 if (!/^\/(drive|drive_offline|Downloads)$/.test(mountPath) && 531 if (!/^\/(drive|drive_offline|Downloads)$/.test(mountPath) &&
525 !/^\/((archive|removable|drive)\/[^\/]+)$/.test(mountPath)) 532 !/^\/((archive|removable|drive)\/[^\/]+)$/.test(mountPath))
526 throw new Error('Invalid mount path: ', mountPath); 533 throw new Error('Invalid mount path: ', mountPath);
527 }; 534 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698