| 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 /** | 5 /** |
| 6 * Responsible for showing banners in the file list. | 6 * Responsible for showing banners in the file list. |
| 7 * @param {DirectoryModel} directoryModel The model. | 7 * @param {DirectoryModel} directoryModel The model. |
| 8 * @param {VolumeManager} volumeManager The manager. | 8 * @param {VolumeManager} volumeManager The manager. |
| 9 * @param {DOMDocument} document HTML document. | 9 * @param {DOMDocument} document HTML document. |
| 10 * @param {boolean} showOffers True if we should show offer banners. | 10 * @param {boolean} showOffers True if we should show offer banners. |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 else | 357 else |
| 358 self.showLowDriveSpaceWarning_(lowDiskSpace, sizeStats); | 358 self.showLowDriveSpaceWarning_(lowDiskSpace, sizeStats); |
| 359 | 359 |
| 360 // If disk space is low, check it more often. User can delete files | 360 // If disk space is low, check it more often. User can delete files |
| 361 // manually and we should not bother her with warning in this case. | 361 // manually and we should not bother her with warning in this case. |
| 362 scheduleCheck(lowDiskSpace ? 1000 * 5 : 1000 * 30, root, threshold); | 362 scheduleCheck(lowDiskSpace ? 1000 * 5 : 1000 * 30, root, threshold); |
| 363 }); | 363 }); |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 // TODO(kaznacheev): Unify the two low space warning. | 366 // TODO(kaznacheev): Unify the two low space warning. |
| 367 var root = PathUtil.getRootPath(currentPath); | 367 var root = PathUtil.getTopDirectory(currentPath); |
| 368 if (root === RootDirectory.DOWNLOADS) { | 368 if (root === RootDirectory.DOWNLOADS) { |
| 369 scheduleCheck(500, root, 0.2); | 369 scheduleCheck(500, root, 0.2); |
| 370 this.showLowDriveSpaceWarning_(false); | 370 this.showLowDriveSpaceWarning_(false); |
| 371 } else if (root === RootDirectory.DRIVE) { | 371 } else if (root === RootDirectory.DRIVE) { |
| 372 scheduleCheck(500, root, 0.1); | 372 scheduleCheck(500, root, 0.1); |
| 373 this.showLowDownloadsSpaceWarning_(false); | 373 this.showLowDownloadsSpaceWarning_(false); |
| 374 } else { | 374 } else { |
| 375 scheduleCheck(0); | 375 scheduleCheck(0); |
| 376 | 376 |
| 377 this.showLowDownloadsSpaceWarning_(false); | 377 this.showLowDownloadsSpaceWarning_(false); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 * @param {function} completeCallback To be called (may be directly) when | 586 * @param {function} completeCallback To be called (may be directly) when |
| 587 * this.newWelcome_ get ready. | 587 * this.newWelcome_ get ready. |
| 588 * @private | 588 * @private |
| 589 */ | 589 */ |
| 590 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { | 590 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { |
| 591 if (this.newWelcome_ !== undefined) | 591 if (this.newWelcome_ !== undefined) |
| 592 completeCallback(); | 592 completeCallback(); |
| 593 else | 593 else |
| 594 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); | 594 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); |
| 595 }; | 595 }; |
| OLD | NEW |