| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 threshold = 0.1; | 507 threshold = 0.1; |
| 508 break; | 508 break; |
| 509 default: | 509 default: |
| 510 // If the current file system is neither the DOWNLOAD nor the DRIVE, | 510 // If the current file system is neither the DOWNLOAD nor the DRIVE, |
| 511 // just hide the warning. | 511 // just hide the warning. |
| 512 this.showLowDownloadsSpaceWarning_(false); | 512 this.showLowDownloadsSpaceWarning_(false); |
| 513 this.showLowDriveSpaceWarning_(false); | 513 this.showLowDriveSpaceWarning_(false); |
| 514 return; | 514 return; |
| 515 } | 515 } |
| 516 | 516 |
| 517 // If not mounted correctly, then do not continue. |
| 518 if (!volume.root) |
| 519 return; |
| 520 |
| 517 chrome.fileBrowserPrivate.getSizeStats( | 521 chrome.fileBrowserPrivate.getSizeStats( |
| 518 volume.getDisplayRootDirectoryURL(), | 522 volume.root.toURL(), |
| 519 function(sizeStats) { | 523 function(sizeStats) { |
| 520 var currentVolume = this.volumeManager_.getVolumeInfo( | 524 var currentVolume = this.volumeManager_.getVolumeInfo( |
| 521 this.directoryModel_.getCurrentDirEntry()); | 525 this.directoryModel_.getCurrentDirEntry()); |
| 522 if (volume !== currentVolume) { | 526 if (volume !== currentVolume) { |
| 523 // This happens when the current directory is moved during requesting | 527 // This happens when the current directory is moved during requesting |
| 524 // the file system size. Just ignore it. | 528 // the file system size. Just ignore it. |
| 525 return; | 529 return; |
| 526 } | 530 } |
| 527 // sizeStats is undefined, if some error occurs. | 531 // sizeStats is undefined, if some error occurs. |
| 528 if (!sizeStats || sizeStats.totalSize == 0) | 532 if (!sizeStats || sizeStats.totalSize == 0) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 * @private | 657 * @private |
| 654 */ | 658 */ |
| 655 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { | 659 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { |
| 656 var connection = this.volumeManager_.getDriveConnectionState(); | 660 var connection = this.volumeManager_.getDriveConnectionState(); |
| 657 var showDriveNotReachedMessage = | 661 var showDriveNotReachedMessage = |
| 658 this.isOnCurrentProfileDrive() && | 662 this.isOnCurrentProfileDrive() && |
| 659 connection.type == util.DriveConnectionType.OFFLINE && | 663 connection.type == util.DriveConnectionType.OFFLINE && |
| 660 connection.reason == util.DriveConnectionReason.NOT_READY; | 664 connection.reason == util.DriveConnectionReason.NOT_READY; |
| 661 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; | 665 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; |
| 662 }; | 666 }; |
| OLD | NEW |