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

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

Issue 13871005: filemanager: Show Drive related gear menu for the sidebar "Shared with me", "Recent", "Offline". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * This variable is checked in SelectFileDialogExtensionBrowserTest. 8 * This variable is checked in SelectFileDialogExtensionBrowserTest.
9 * @type {number} 9 * @type {number}
10 */ 10 */
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 this.table_.updateFileMetadata(leadListItem, leadEntry); 1657 this.table_.updateFileMetadata(leadListItem, leadEntry);
1658 } 1658 }
1659 this.currentList_.restoreLeadItem(leadListItem); 1659 this.currentList_.restoreLeadItem(leadListItem);
1660 }; 1660 };
1661 1661
1662 /** 1662 /**
1663 * @return {boolean} True if the current directory content is from Google 1663 * @return {boolean} True if the current directory content is from Google
1664 * Drive. 1664 * Drive.
1665 */ 1665 */
1666 FileManager.prototype.isOnDrive = function() { 1666 FileManager.prototype.isOnDrive = function() {
1667 return this.directoryModel_.getCurrentRootType() === RootType.DRIVE || 1667 var rootType = this.directoryModel_.getCurrentRootType();
1668 this.directoryModel_.getCurrentRootType() === RootType.DRIVE_OFFLINE; 1668 return rootType === RootType.DRIVE ||
1669 rootType === RootType.DRIVE_SHARED_WITH_ME ||
1670 rootType === RootType.DRIVE_RECENT ||
1671 rootType === RootType.DRIVE_OFFLINE;
1669 }; 1672 };
1670 1673
1671 /** 1674 /**
1672 * @return {boolean} True if the ctrl key is pressed now. 1675 * @return {boolean} True if the ctrl key is pressed now.
1673 */ 1676 */
1674 FileManager.prototype.isCtrlKeyPressed = function() { 1677 FileManager.prototype.isCtrlKeyPressed = function() {
1675 return this.ctrlKeyPressed_; 1678 return this.ctrlKeyPressed_;
1676 }; 1679 };
1677 1680
1678 /** 1681 /**
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 FileManager.prototype.updateSearchBoxOnDirChange_ = function() { 2088 FileManager.prototype.updateSearchBoxOnDirChange_ = function() {
2086 if (!this.searchBox_.disabled) 2089 if (!this.searchBox_.disabled)
2087 this.searchBox_.value = ''; 2090 this.searchBox_.value = '';
2088 }; 2091 };
2089 2092
2090 /** 2093 /**
2091 * Update the gear menu. 2094 * Update the gear menu.
2092 * @private 2095 * @private
2093 */ 2096 */
2094 FileManager.prototype.updateGearMenu_ = function() { 2097 FileManager.prototype.updateGearMenu_ = function() {
2095 this.syncButton.hidden = !this.isOnDrive(); 2098 var hideItemsForDrive = !this.isOnDrive();
2096 this.hostedButton.hidden = !this.isOnDrive(); 2099 this.syncButton.hidden = hideItemsForDrive;
2100 this.hostedButton.hidden = hideItemsForDrive;
2097 this.document_.getElementById('drive-separator').hidden = 2101 this.document_.getElementById('drive-separator').hidden =
2098 !this.isOnDrive(); 2102 hideItemsForDrive;
2099 2103
2100 // If volume has changed, then fetch remaining space data. 2104 // If volume has changed, then fetch remaining space data.
2101 if (this.previousRootUrl_ != this.directoryModel_.getCurrentMountPointUrl()) 2105 if (this.previousRootUrl_ != this.directoryModel_.getCurrentMountPointUrl())
2102 this.refreshRemainingSpace_(true); // Show loading caption. 2106 this.refreshRemainingSpace_(true); // Show loading caption.
2103 2107
2104 this.previousRootUrl_ = this.directoryModel_.getCurrentMountPointUrl(); 2108 this.previousRootUrl_ = this.directoryModel_.getCurrentMountPointUrl();
2105 }; 2109 };
2106 2110
2107 /** 2111 /**
2108 * Refreshes space info of the current volume. 2112 * Refreshes space info of the current volume.
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
3510 * Set the flag expressing whether the ctrl key is pressed or not. 3514 * Set the flag expressing whether the ctrl key is pressed or not.
3511 * @param {boolean} flag New value of the flag 3515 * @param {boolean} flag New value of the flag
3512 * @private 3516 * @private
3513 */ 3517 */
3514 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { 3518 FileManager.prototype.setCtrlKeyPressed_ = function(flag) {
3515 this.ctrlKeyPressed_ = flag; 3519 this.ctrlKeyPressed_ = flag;
3516 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); 3520 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange();
3517 this.document_.querySelector('#drive-reload').canExecuteChange(); 3521 this.document_.querySelector('#drive-reload').canExecuteChange();
3518 }; 3522 };
3519 })(); 3523 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698