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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/drive_banners.js

Issue 179553008: Simplify volume manager in Files app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unmounting. Created 6 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
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 '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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 break; 510 break;
511 default: 511 default:
512 // If the current file system is neither the DOWNLOAD nor the DRIVE, 512 // If the current file system is neither the DOWNLOAD nor the DRIVE,
513 // just hide the warning. 513 // just hide the warning.
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.root) 520 if (!volume.fileSystem)
521 return; 521 return;
522 522
523 chrome.fileBrowserPrivate.getSizeStats( 523 chrome.fileBrowserPrivate.getSizeStats(
524 volume.root.toURL(), 524 volume.fileSystem.root.toURL(),
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698