OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Responsible for showing following banners in the file list. | 8 * Responsible for showing following banners in the file list. |
9 * - WelcomeBanner | 9 * - WelcomeBanner |
10 * - AuthFailBanner | 10 * - AuthFailBanner |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 this.showLowDownloadsSpaceWarning_(false); | 514 this.showLowDownloadsSpaceWarning_(false); |
515 this.showLowDriveSpaceWarning_(false); | 515 this.showLowDriveSpaceWarning_(false); |
516 return; | 516 return; |
517 } | 517 } |
518 | 518 |
519 // If not mounted correctly, then do not continue. | 519 // If not mounted correctly, then do not continue. |
520 if (!volume.fileSystem) | 520 if (!volume.fileSystem) |
521 return; | 521 return; |
522 | 522 |
523 chrome.fileBrowserPrivate.getSizeStats( | 523 chrome.fileBrowserPrivate.getSizeStats( |
524 volume.fileSystem.root.toURL(), | 524 volume.volumeId, |
525 function(sizeStats) { | 525 function(sizeStats) { |
526 var currentVolume = this.volumeManager_.getVolumeInfo( | 526 var currentVolume = this.volumeManager_.getVolumeInfo( |
527 this.directoryModel_.getCurrentDirEntry()); | 527 this.directoryModel_.getCurrentDirEntry()); |
528 if (volume !== currentVolume) { | 528 if (volume !== currentVolume) { |
529 // This happens when the current directory is moved during requesting | 529 // This happens when the current directory is moved during requesting |
530 // the file system size. Just ignore it. | 530 // the file system size. Just ignore it. |
531 return; | 531 return; |
532 } | 532 } |
533 // sizeStats is undefined, if some error occurs. | 533 // sizeStats is undefined, if some error occurs. |
534 if (!sizeStats || sizeStats.totalSize == 0) | 534 if (!sizeStats || sizeStats.totalSize == 0) |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 * @private | 660 * @private |
661 */ | 661 */ |
662 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { | 662 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { |
663 var connection = this.volumeManager_.getDriveConnectionState(); | 663 var connection = this.volumeManager_.getDriveConnectionState(); |
664 var showDriveNotReachedMessage = | 664 var showDriveNotReachedMessage = |
665 this.isOnCurrentProfileDrive() && | 665 this.isOnCurrentProfileDrive() && |
666 connection.type == util.DriveConnectionType.OFFLINE && | 666 connection.type == util.DriveConnectionType.OFFLINE && |
667 connection.reason == util.DriveConnectionReason.NOT_READY; | 667 connection.reason == util.DriveConnectionReason.NOT_READY; |
668 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; | 668 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; |
669 }; | 669 }; |
OLD | NEW |