| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 } | 646 } |
| 647 }; | 647 }; |
| 648 | 648 |
| 649 /** | 649 /** |
| 650 * Updates the visibility of Drive Connection Warning banner, retrieving the | 650 * Updates the visibility of Drive Connection Warning banner, retrieving the |
| 651 * current connection information. | 651 * current connection information. |
| 652 * @private | 652 * @private |
| 653 */ | 653 */ |
| 654 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { | 654 FileListBannerController.prototype.maybeShowAuthFailBanner_ = function() { |
| 655 var connection = this.volumeManager_.getDriveConnectionState(); | 655 var connection = this.volumeManager_.getDriveConnectionState(); |
| 656 var reasons = connection.reasons; | |
| 657 var showDriveNotReachedMessage = | 656 var showDriveNotReachedMessage = |
| 658 this.isOnCurrentProfileDrive() && | 657 this.isOnCurrentProfileDrive() && |
| 659 connection.type == util.DriveConnectionType.OFFLINE && | 658 connection.type == util.DriveConnectionType.OFFLINE && |
| 660 // Show the banner only when authentication fails. Don't show it when the | 659 connection.reason == util.DriveConnectionReason.NOT_READY; |
| 661 // drive service is disabled. | |
| 662 reasons.indexOf(util.DriveConnectionReason.NOT_READY) != -1 && | |
| 663 reasons.indexOf(util.DriveConnectionReason.NO_SERVICE) == -1; | |
| 664 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; | 660 this.authFailedBanner_.hidden = !showDriveNotReachedMessage; |
| 665 }; | 661 }; |
| OLD | NEW |