| 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 * Represents each volume, such as "drive", "download directory", each "USB | 6 * Represents each volume, such as "drive", "download directory", each "USB |
| 7 * flush storage", or "mounted zip archive" etc. | 7 * flush storage", or "mounted zip archive" etc. |
| 8 * | 8 * |
| 9 * @constructor | 9 * @constructor |
| 10 * @struct | 10 * @struct |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 * @const | 369 * @const |
| 370 * @private | 370 * @private |
| 371 */ | 371 */ |
| 372 volumeManagerUtil.volumeListOrder_ = [ | 372 volumeManagerUtil.volumeListOrder_ = [ |
| 373 VolumeManagerCommon.VolumeType.DRIVE, | 373 VolumeManagerCommon.VolumeType.DRIVE, |
| 374 VolumeManagerCommon.VolumeType.DOWNLOADS, | 374 VolumeManagerCommon.VolumeType.DOWNLOADS, |
| 375 VolumeManagerCommon.VolumeType.ARCHIVE, | 375 VolumeManagerCommon.VolumeType.ARCHIVE, |
| 376 VolumeManagerCommon.VolumeType.REMOVABLE, | 376 VolumeManagerCommon.VolumeType.REMOVABLE, |
| 377 VolumeManagerCommon.VolumeType.MTP, | 377 VolumeManagerCommon.VolumeType.MTP, |
| 378 VolumeManagerCommon.VolumeType.PROVIDED, | 378 VolumeManagerCommon.VolumeType.PROVIDED, |
| 379 VolumeManagerCommon.VolumeType.PLUGIN_PROVIDED, |
| 379 ]; | 380 ]; |
| 380 | 381 |
| 381 /** | 382 /** |
| 382 * Orders two volumes by volumeType and volumeId. | 383 * Orders two volumes by volumeType and volumeId. |
| 383 * | 384 * |
| 384 * The volumes at first are compared by volume type in the order of | 385 * The volumes at first are compared by volume type in the order of |
| 385 * volumeListOrder_. Then they are compared by volume ID. | 386 * volumeListOrder_. Then they are compared by volume ID. |
| 386 * | 387 * |
| 387 * @param {!VolumeInfo} volumeInfo1 Volume info to be compared. | 388 * @param {!VolumeInfo} volumeInfo1 Volume info to be compared. |
| 388 * @param {!VolumeInfo} volumeInfo2 Volume info to be compared. | 389 * @param {!VolumeInfo} volumeInfo2 Volume info to be compared. |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 break; | 957 break; |
| 957 case VolumeManagerCommon.VolumeType.ARCHIVE: | 958 case VolumeManagerCommon.VolumeType.ARCHIVE: |
| 958 rootType = VolumeManagerCommon.RootType.ARCHIVE; | 959 rootType = VolumeManagerCommon.RootType.ARCHIVE; |
| 959 break; | 960 break; |
| 960 case VolumeManagerCommon.VolumeType.MTP: | 961 case VolumeManagerCommon.VolumeType.MTP: |
| 961 rootType = VolumeManagerCommon.RootType.MTP; | 962 rootType = VolumeManagerCommon.RootType.MTP; |
| 962 break; | 963 break; |
| 963 case VolumeManagerCommon.VolumeType.PROVIDED: | 964 case VolumeManagerCommon.VolumeType.PROVIDED: |
| 964 rootType = VolumeManagerCommon.RootType.PROVIDED; | 965 rootType = VolumeManagerCommon.RootType.PROVIDED; |
| 965 break; | 966 break; |
| 967 case VolumeManagerCommon.VolumeType.PLUGIN_PROVIDED: |
| 968 rootType = VolumeManagerCommon.RootType.PLUGIN_PROVIDED; |
| 969 break; |
| 966 default: | 970 default: |
| 967 // Programming error, throw an exception. | 971 // Programming error, throw an exception. |
| 968 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); | 972 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); |
| 969 } | 973 } |
| 970 isReadOnly = volumeInfo.isReadOnly; | 974 isReadOnly = volumeInfo.isReadOnly; |
| 971 isRootEntry = util.isSameEntry(entry, volumeInfo.fileSystem.root); | 975 isRootEntry = util.isSameEntry(entry, volumeInfo.fileSystem.root); |
| 972 } | 976 } |
| 973 | 977 |
| 974 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); | 978 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); |
| 975 }; | 979 }; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 this.isDriveBased; | 1124 this.isDriveBased; |
| 1121 | 1125 |
| 1122 /** | 1126 /** |
| 1123 * Whether the entry is read only or not. | 1127 * Whether the entry is read only or not. |
| 1124 * @type {boolean} | 1128 * @type {boolean} |
| 1125 */ | 1129 */ |
| 1126 this.isReadOnly = isReadOnly; | 1130 this.isReadOnly = isReadOnly; |
| 1127 | 1131 |
| 1128 Object.freeze(this); | 1132 Object.freeze(this); |
| 1129 } | 1133 } |
| OLD | NEW |