Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 }); | 194 }); |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 /** | 197 /** |
| 198 * The order of the volume list based on root type. | 198 * The order of the volume list based on root type. |
| 199 * @type {Array.<string>} | 199 * @type {Array.<string>} |
| 200 * @const | 200 * @const |
| 201 * @private | 201 * @private |
| 202 */ | 202 */ |
| 203 volumeManagerUtil.volumeListOrder_ = [ | 203 volumeManagerUtil.volumeListOrder_ = [ |
| 204 RootType.DRIVE, RootType.DOWNLOADS, RootType.ARCHIVE, RootType.REMOVABLE | 204 RootType.DRIVE, RootType.DOWNLOADS, RootType.ARCHIVE, RootType.REMOVABLE, |
|
Vitaly Buka (NO REVIEWS)
2014/01/07 21:08:49
does not feet one line, can you please make it one
Noam Samuel
2014/01/07 22:10:59
Done.
| |
| 205 RootType.PRIVET | |
|
Vitaly Buka (NO REVIEWS)
2014/01/07 21:08:49
not sure if content of [] should be intended by 2
Noam Samuel
2014/01/07 22:10:59
Was previously 2 spaces.
| |
| 205 ]; | 206 ]; |
| 206 | 207 |
| 207 /** | 208 /** |
| 208 * Compares mount paths to sort the volume list order. | 209 * Compares mount paths to sort the volume list order. |
| 209 * @param {string} mountPath1 The mount path for the first volume. | 210 * @param {string} mountPath1 The mount path for the first volume. |
| 210 * @param {string} mountPath2 The mount path for the second volume. | 211 * @param {string} mountPath2 The mount path for the second volume. |
| 211 * @return {number} 0 if mountPath1 and mountPath2 are same, -1 if VolumeInfo | 212 * @return {number} 0 if mountPath1 and mountPath2 are same, -1 if VolumeInfo |
| 212 * mounted at mountPath1 should be listed before the one mounted at | 213 * mounted at mountPath1 should be listed before the one mounted at |
| 213 * mountPath2, otherwise 1. | 214 * mountPath2, otherwise 1. |
| 214 */ | 215 */ |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 switch (volumeInfo.volumeType) { | 693 switch (volumeInfo.volumeType) { |
| 693 case util.VolumeType.DOWNLOADS: | 694 case util.VolumeType.DOWNLOADS: |
| 694 rootType = RootType.DOWNLOADS; | 695 rootType = RootType.DOWNLOADS; |
| 695 break; | 696 break; |
| 696 case util.VolumeType.REMOVABLE: | 697 case util.VolumeType.REMOVABLE: |
| 697 rootType = RootType.REMOVABLE; | 698 rootType = RootType.REMOVABLE; |
| 698 break; | 699 break; |
| 699 case util.VolumeType.ARCHIVE: | 700 case util.VolumeType.ARCHIVE: |
| 700 rootType = RootType.ARCHIVE; | 701 rootType = RootType.ARCHIVE; |
| 701 break; | 702 break; |
| 703 case util.VolumeType.PRIVET: | |
| 704 rootType = RootType.PRIVET; | |
| 705 break; | |
| 702 default: | 706 default: |
| 703 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); | 707 throw new Error('Invalid volume type: ' + volumeInfo.volumeType); |
| 704 } | 708 } |
| 705 isReadOnly = volumeInfo.isReadOnly; | 709 isReadOnly = volumeInfo.isReadOnly; |
| 706 } | 710 } |
| 707 var isRootEntry = (entry.fullPath.substr(0, rootPath.length) || '/') === | 711 var isRootEntry = (entry.fullPath.substr(0, rootPath.length) || '/') === |
| 708 entry.fullPath; | 712 entry.fullPath; |
| 709 | 713 |
| 710 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); | 714 return new EntryLocation(volumeInfo, rootType, isRootEntry, isReadOnly); |
| 711 }; | 715 }; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 this.isDriveBased; | 848 this.isDriveBased; |
| 845 | 849 |
| 846 /** | 850 /** |
| 847 * Whether the entry is read only or not. | 851 * Whether the entry is read only or not. |
| 848 * @type {boolean} | 852 * @type {boolean} |
| 849 */ | 853 */ |
| 850 this.isReadOnly = isReadOnly; | 854 this.isReadOnly = isReadOnly; |
| 851 | 855 |
| 852 Object.freeze(this); | 856 Object.freeze(this); |
| 853 } | 857 } |
| OLD | NEW |