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

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

Issue 98493003: Simplify fileBrowserPrivate.getDriveConnectionStatus(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the util function name. Created 7 years 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698