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 * Represents each volume, such as "drive", "download directory", each "USB | 8 * Represents each volume, such as "drive", "download directory", each "USB |
9 * flush storage", or "mounted zip archive" etc. | 9 * flush storage", or "mounted zip archive" etc. |
10 * | 10 * |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 }); | 198 }); |
199 }; | 199 }; |
200 | 200 |
201 /** | 201 /** |
202 * The order of the volume list based on root type. | 202 * The order of the volume list based on root type. |
203 * @type {Array.<string>} | 203 * @type {Array.<string>} |
204 * @const | 204 * @const |
205 * @private | 205 * @private |
206 */ | 206 */ |
207 volumeManagerUtil.volumeListOrder_ = [ | 207 volumeManagerUtil.volumeListOrder_ = [ |
208 RootType.DRIVE, RootType.DOWNLOADS, RootType.ARCHIVE, RootType.REMOVABLE | 208 RootType.DRIVE, |
| 209 RootType.DOWNLOADS, |
| 210 RootType.ARCHIVE, |
| 211 RootType.REMOVABLE, |
| 212 RootType.CLOUD_DEVICE |
209 ]; | 213 ]; |
210 | 214 |
211 /** | 215 /** |
212 * Compares mount paths to sort the volume list order. | 216 * Compares mount paths to sort the volume list order. |
213 * @param {string} mountPath1 The mount path for the first volume. | 217 * @param {string} mountPath1 The mount path for the first volume. |
214 * @param {string} mountPath2 The mount path for the second volume. | 218 * @param {string} mountPath2 The mount path for the second volume. |
215 * @return {number} 0 if mountPath1 and mountPath2 are same, -1 if VolumeInfo | 219 * @return {number} 0 if mountPath1 and mountPath2 are same, -1 if VolumeInfo |
216 * mounted at mountPath1 should be listed before the one mounted at | 220 * mounted at mountPath1 should be listed before the one mounted at |
217 * mountPath2, otherwise 1. | 221 * mountPath2, otherwise 1. |
218 */ | 222 */ |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 switch (volumeInfo.volumeType) { | 700 switch (volumeInfo.volumeType) { |
697 case util.VolumeType.DOWNLOADS: | 701 case util.VolumeType.DOWNLOADS: |
698 rootType = RootType.DOWNLOADS; | 702 rootType = RootType.DOWNLOADS; |
699 break; | 703 break; |
700 case util.VolumeType.REMOVABLE: | 704 case util.VolumeType.REMOVABLE: |
701 rootType = RootType.REMOVABLE; | 705 rootType = RootType.REMOVABLE; |
702 break; | 706 break; |
703 case util.VolumeType.ARCHIVE: | 707 case util.VolumeType.ARCHIVE: |
704 rootType = RootType.ARCHIVE; | 708 rootType = RootType.ARCHIVE; |
705 break; | 709 break; |
| 710 case util.VolumeType.CLOUD_DEVICE: |
| 711 rootType = RootType.CLOUD_DEVICE; |
| 712 break; |
706 default: | 713 default: |
707 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); | 714 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); |
708 } | 715 } |
709 isReadOnly = volumeInfo.isReadOnly; | 716 isReadOnly = volumeInfo.isReadOnly; |
710 } | 717 } |
711 var isRootEntry = (entry.fullPath.substr(0, rootPath.length) || '/') === | 718 var isRootEntry = (entry.fullPath.substr(0, rootPath.length) || '/') === |
712 entry.fullPath; | 719 entry.fullPath; |
713 | 720 |
714 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); | 721 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); |
715 }; | 722 }; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 this.isDriveBased; | 855 this.isDriveBased; |
849 | 856 |
850 /** | 857 /** |
851 * Whether the entry is read only or not. | 858 * Whether the entry is read only or not. |
852 * @type {boolean} | 859 * @type {boolean} |
853 */ | 860 */ |
854 this.isReadOnly = isReadOnly; | 861 this.isReadOnly = isReadOnly; |
855 | 862 |
856 Object.freeze(this); | 863 Object.freeze(this); |
857 } | 864 } |
OLD | NEW |