| 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 24 matching lines...) Expand all Loading... |
| 35 this.mountPath = mountPath; | 35 this.mountPath = mountPath; |
| 36 this.volumeId = volumeId; | 36 this.volumeId = volumeId; |
| 37 this.root = root; | 37 this.root = root; |
| 38 this.fakeEntries = {}; | 38 this.fakeEntries = {}; |
| 39 | 39 |
| 40 if (volumeType === util.VolumeType.DRIVE) { | 40 if (volumeType === util.VolumeType.DRIVE) { |
| 41 this.fakeEntries[RootType.DRIVE] = { | 41 this.fakeEntries[RootType.DRIVE] = { |
| 42 fullPath: RootDirectory.DRIVE + '/' + DriveSubRootDirectory.ROOT, | 42 fullPath: RootDirectory.DRIVE + '/' + DriveSubRootDirectory.ROOT, |
| 43 isDirectory: true, | 43 isDirectory: true, |
| 44 rootType: RootType.DRIVE, | 44 rootType: RootType.DRIVE, |
| 45 label: PathUtil.getRootLabel(RootType.DRIVE) | 45 label: PathUtil.getRootLabel(RootType.DRIVE), |
| 46 toURL: function() { return 'fake-entry://' + this.fullPath; } |
| 46 }; | 47 }; |
| 47 this.fakeEntries[RootType.DRIVE_OFFLINE] = { | 48 this.fakeEntries[RootType.DRIVE_OFFLINE] = { |
| 48 fullPath: RootDirectory.DRIVE_OFFLINE, | 49 fullPath: RootDirectory.DRIVE_OFFLINE, |
| 49 isDirectory: true, | 50 isDirectory: true, |
| 50 rootType: RootType.DRIVE_OFFLINE, | 51 rootType: RootType.DRIVE_OFFLINE, |
| 51 label: PathUtil.getRootLabel(RootType.DRIVE_OFFLINE) | 52 label: PathUtil.getRootLabel(RootType.DRIVE_OFFLINE), |
| 53 toURL: function() { return 'fake-entry://' + this.fullPath; } |
| 52 }; | 54 }; |
| 53 this.fakeEntries[RootType.DRIVE_SHARED_WITH_ME] = { | 55 this.fakeEntries[RootType.DRIVE_SHARED_WITH_ME] = { |
| 54 fullPath: RootDirectory.DRIVE_SHARED_WITH_ME, | 56 fullPath: RootDirectory.DRIVE_SHARED_WITH_ME, |
| 55 isDirectory: true, | 57 isDirectory: true, |
| 56 rootType: RootType.DRIVE_SHARED_WITH_ME, | 58 rootType: RootType.DRIVE_SHARED_WITH_ME, |
| 57 label: PathUtil.getRootLabel(RootType.DRIVE_SHARED_WITH_ME) | 59 label: PathUtil.getRootLabel(RootType.DRIVE_SHARED_WITH_ME), |
| 60 toURL: function() { return 'fake-entry://' + this.fullPath; } |
| 58 }; | 61 }; |
| 59 this.fakeEntries[RootType.DRIVE_RECENT] = { | 62 this.fakeEntries[RootType.DRIVE_RECENT] = { |
| 60 fullPath: RootDirectory.DRIVE_RECENT, | 63 fullPath: RootDirectory.DRIVE_RECENT, |
| 61 isDirectory: true, | 64 isDirectory: true, |
| 62 rootType: RootType.DRIVE_RECENT, | 65 rootType: RootType.DRIVE_RECENT, |
| 63 label: PathUtil.getRootLabel(RootType.DRIVE_RECENT) | 66 label: PathUtil.getRootLabel(RootType.DRIVE_RECENT), |
| 67 toURL: function() { return 'fake-entry://' + this.fullPath; } |
| 64 }; | 68 }; |
| 65 } | 69 } |
| 66 | 70 |
| 67 // Note: This represents if the mounting of the volume is successfully done | 71 // Note: This represents if the mounting of the volume is successfully done |
| 68 // or not. (If error is empty string, the mount is successfully done). | 72 // or not. (If error is empty string, the mount is successfully done). |
| 69 // TODO(hidehiko): Rename to make this more understandable. | 73 // TODO(hidehiko): Rename to make this more understandable. |
| 70 this.error = error; | 74 this.error = error; |
| 71 this.deviceType = deviceType; | 75 this.deviceType = deviceType; |
| 72 this.isReadOnly = isReadOnly; | 76 this.isReadOnly = isReadOnly; |
| 73 this.profile = Object.freeze(profile); | 77 this.profile = Object.freeze(profile); |
| (...skipping 770 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 |