Commit e45d066b authored by François Degros's avatar François Degros Committed by Commit Bot

[Files app] ES6 class for volume_manager.js and volume_info.js

Added property isReadOnlyRemovableDevice to interface VolumeInfo.

Added method dispose() to interface VolumeManager, since it is called by
Gallery.onPageHide_(). Added dummy implementation of dispose() to
VolumeManagerImpl and MockVolumeManager. FilteredVolumeManager already has a
dispose() implementation.

Made VolumeManagerImpl.initialize() public since it is called by
volumeManagerFactory.getInstance().


Bug: 778674
Change-Id: I978caaa79579fb8ea1f04fa207fe5c304e163a1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614771
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Auto-Submit: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660747}
parent 119284a1
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* The inner list ownership is shared between FilteredVolumeInfoList and * The inner list ownership is shared between FilteredVolumeInfoList and
* FilteredVolumeManager to enforce these constraints. * FilteredVolumeManager to enforce these constraints.
* *
* @final
* @implements {VolumeInfoList} * @implements {VolumeInfoList}
*/ */
class FilteredVolumeInfoList { class FilteredVolumeInfoList {
...@@ -16,29 +17,35 @@ class FilteredVolumeInfoList { ...@@ -16,29 +17,35 @@ class FilteredVolumeInfoList {
* @param {!cr.ui.ArrayDataModel} list * @param {!cr.ui.ArrayDataModel} list
*/ */
constructor(list) { constructor(list) {
/** @private */ /** @private @const */
this.list_ = list; this.list_ = list;
} }
/** @override */ /** @override */
get length() { get length() {
return this.list_.length; return this.list_.length;
} }
/** @override */ /** @override */
addEventListener(type, handler) { addEventListener(type, handler) {
this.list_.addEventListener(type, handler); this.list_.addEventListener(type, handler);
} }
/** @override */ /** @override */
removeEventListener(type, handler) { removeEventListener(type, handler) {
this.list_.removeEventListener(type, handler); this.list_.removeEventListener(type, handler);
} }
/** @override */ /** @override */
add(volumeInfo) { add(volumeInfo) {
throw new Error('FilteredVolumeInfoList.add not allowed in foreground'); throw new Error('FilteredVolumeInfoList.add not allowed in foreground');
} }
/** @override */ /** @override */
remove(volumeInfo) { remove(volumeInfo) {
throw new Error('FilteredVolumeInfoList.remove not allowed in foreground'); throw new Error('FilteredVolumeInfoList.remove not allowed in foreground');
} }
/** @override */ /** @override */
item(index) { item(index) {
return /** @type {!VolumeInfo} */ (this.list_.item(index)); return /** @type {!VolumeInfo} */ (this.list_.item(index));
......
...@@ -7,131 +7,137 @@ ...@@ -7,131 +7,137 @@
* flush storage", or "mounted zip archive" etc. * flush storage", or "mounted zip archive" etc.
* @interface * @interface
*/ */
function VolumeInfo() {} class VolumeInfo {
constructor() {
/** @type {VolumeManagerCommon.VolumeType} */ /** @type {VolumeManagerCommon.VolumeType} */
VolumeInfo.prototype.volumeType; this.volumeType;
/** @type {string} */ /** @type {string} */
VolumeInfo.prototype.volumeId; this.volumeId;
/** @type {FileSystem} */ /** @type {FileSystem} */
VolumeInfo.prototype.fileSystem; this.fileSystem;
/** /**
* Display root path. It is null before finishing to resolve the entry. * Display root path. It is null before finishing to resolve the entry.
* @type {DirectoryEntry} * @type {DirectoryEntry}
*/ */
VolumeInfo.prototype.displayRoot; this.displayRoot;
/** /**
* The display root path of Shared Drives directory. It is null before finishing * The display root path of Shared Drives directory. It is null before
* to resolve the entry. Valid only for Drive volume. * finishing to resolve the entry. Valid only for Drive volume.
* @type {DirectoryEntry} * @type {DirectoryEntry}
*/ */
VolumeInfo.prototype.sharedDriveDisplayRoot; this.sharedDriveDisplayRoot;
/** /**
* The display root path of Computers directory. It is null before finishing * The display root path of Computers directory. It is null before finishing
* to resolve the entry. Valid only for Drive volume. * to resolve the entry. Valid only for Drive volume.
* @type {DirectoryEntry} * @type {DirectoryEntry}
*/ */
VolumeInfo.prototype.computersDisplayRoot; this.computersDisplayRoot;
/** /**
* The volume's fake entries such as Recent, Offline, Shared with me, etc... * The volume's fake entries such as Recent, Offline, Shared with me, etc...
* in Google Drive. * in Google Drive.
* @type {Object<!FakeEntry>}} * @type {Object<!FakeEntry>}}
*/ */
VolumeInfo.prototype.fakeEntries; this.fakeEntries;
/** /**
* This represents if the mounting of the volume is successfully done or not. * This represents if the mounting of the volume is successfully done or
* (If error is empty string, the mount is successfully done) * not. (If error is empty string, the mount is successfully done)
* @type {(string|undefined)} * @type {(string|undefined)}
*/ */
VolumeInfo.prototype.error; this.error;
/** /**
* The type of device. (e.g. USB, SD card, DVD etc.) * The type of device. (e.g. USB, SD card, DVD etc.)
* @type {(string|undefined)} * @type {(string|undefined)}
*/ */
VolumeInfo.prototype.deviceType; this.deviceType;
/** /**
* If the volume is removable, devicePath is the path of the system device this * If the volume is removable, devicePath is the path of the system device
* device's block is a part of. (e.g. /sys/devices/pci0000:00/.../8:0:0:0/) * this device's block is a part of. (e.g.
* Otherwise, this should be empty. * /sys/devices/pci0000:00/.../8:0:0:0/) Otherwise, this should be empty.
* @type {(string|undefined)} * @type {(string|undefined)}
*/ */
VolumeInfo.prototype.devicePath; this.devicePath;
/** @type {boolean} */ /** @type {boolean} */
VolumeInfo.prototype.isReadOnly; this.isReadOnly;
/** @type {!{displayName:string, isCurrentProfile:boolean}} */ /**
VolumeInfo.prototype.profile; * @type {boolean} Whether the device is read-only removable device or not.
*/
/** this.isReadOnlyRemovableDevice;
* Label for the volume if the volume is either removable or a provided file
* system. In case of removables, if disk is a parent, then its label, else /** @type {!{displayName:string, isCurrentProfile:boolean}} */
* parent's label (e.g. "TransMemory"). this.profile;
* @type {string}
*/ /**
VolumeInfo.prototype.label; * Label for the volume if the volume is either removable or a provided file
* system. In case of removables, if disk is a parent, then its label, else
/** * parent's label (e.g. "TransMemory").
* ID of a provider for this volume. * @type {string}
* @type {(string|undefined)} */
*/ this.label;
VolumeInfo.prototype.providerId;
/**
/** * ID of a provider for this volume.
* Set of icons for this volume. * @type {(string|undefined)}
* @type {!chrome.fileManagerPrivate.IconSet} */
*/ this.providerId;
VolumeInfo.prototype.iconSet;
/**
/** * Set of icons for this volume.
* True if the volume contains media. * @type {!chrome.fileManagerPrivate.IconSet}
* @type {boolean} */
*/ this.iconSet;
VolumeInfo.prototype.hasMedia;
/**
/** * True if the volume contains media.
* True if the volume is configurable. * @type {boolean}
* See https://developer.chrome.com/apps/fileSystemProvider. */
* @type {boolean} this.hasMedia;
*/
VolumeInfo.prototype.configurable; /**
* True if the volume is configurable.
/** * See https://developer.chrome.com/apps/fileSystemProvider.
* True if the volume notifies about changes via file/directory watchers. * @type {boolean}
* @type {boolean} */
*/ this.configurable;
VolumeInfo.prototype.watchable;
/**
/** @type {VolumeManagerCommon.Source} */ * True if the volume notifies about changes via file/directory watchers.
VolumeInfo.prototype.source; * @type {boolean}
*/
/** @type {VolumeManagerCommon.FileSystemType} */ this.watchable;
VolumeInfo.prototype.diskFileSystemType;
/** @type {VolumeManagerCommon.Source} */
/** this.source;
* @type {FilesAppEntry} an entry to be used as prefix of this volume on
* breadcrumbs, e.g. "My Files > Downloads", "My Files" is a prefixEntry on /** @type {VolumeManagerCommon.FileSystemType} */
* "Downloads" VolumeInfo. this.diskFileSystemType;
*/
VolumeInfo.prototype.prefixEntry; /**
* @type {FilesAppEntry} an entry to be used as prefix of this volume on
/** * breadcrumbs, e.g. "My Files > Downloads", "My Files" is a prefixEntry
* Starts resolving the display root and obtains it. It may take long time for * on "Downloads" VolumeInfo.
* Drive. Once resolved, it is cached. */
* this.prefixEntry;
* @param {function(!DirectoryEntry)=} opt_onSuccess Success callback with the }
* display root directory as an argument.
* @param {function(*)=} opt_onFailure Failure callback. /**
* @return {!Promise<!DirectoryEntry>} * Starts resolving the display root and obtains it. It may take long time
*/ * for Drive. Once resolved, it is cached.
VolumeInfo.prototype.resolveDisplayRoot = function( *
opt_onSuccess, opt_onFailure) {}; * @param {function(!DirectoryEntry)=} opt_onSuccess Success callback with the
* display root directory as an argument.
* @param {function(*)=} opt_onFailure Failure callback.
* @return {!Promise<!DirectoryEntry>}
*/
resolveDisplayRoot(opt_onSuccess, opt_onFailure) {}
}
...@@ -6,40 +6,42 @@ ...@@ -6,40 +6,42 @@
* The container of the VolumeInfo for each mounted volume. * The container of the VolumeInfo for each mounted volume.
* @interface * @interface
*/ */
function VolumeInfoList() {} class VolumeInfoList {
constructor() {
/** @const {number} */
VolumeInfoList.prototype.length;
}
/** @type {number} */ /**
VolumeInfoList.prototype.length; * Adds the event listener to listen the change of volume info.
* @param {string} type The name of the event.
* @param {function(Event)} handler The handler for the event.
*/
addEventListener(type, handler) {}
/** /**
* Adds the event listener to listen the change of volume info. * Removes the event listener.
* @param {string} type The name of the event. * @param {string} type The name of the event.
* @param {function(Event)} handler The handler for the event. * @param {function(Event)} handler The handler to be removed.
*/ */
VolumeInfoList.prototype.addEventListener = function(type, handler) {}; removeEventListener(type, handler) {}
/** /**
* Removes the event listener. * Adds the volumeInfo to the appropriate position. If there already exists,
* @param {string} type The name of the event. * just replaces it.
* @param {function(Event)} handler The handler to be removed. * @param {VolumeInfo} volumeInfo The information of the new volume.
*/ */
VolumeInfoList.prototype.removeEventListener = function(type, handler) {}; add(volumeInfo) {}
/** /**
* Adds the volumeInfo to the appropriate position. If there already exists, * Removes the VolumeInfo having the given ID.
* just replaces it. * @param {string} volumeId ID of the volume.
* @param {VolumeInfo} volumeInfo The information of the new volume. */
*/ remove(volumeId) {}
VolumeInfoList.prototype.add = function(volumeInfo) {};
/** /**
* Removes the VolumeInfo having the given ID. * @param {number} index The index of the volume in the list.
* @param {string} volumeId ID of the volume. * @return {!VolumeInfo} The VolumeInfo instance.
*/ */
VolumeInfoList.prototype.remove = function(volumeId) {}; item(index) {}
}
/**
* @param {number} index The index of the volume in the list.
* @return {!VolumeInfo} The VolumeInfo instance.
*/
VolumeInfoList.prototype.item = function(index) {};
...@@ -6,119 +6,126 @@ ...@@ -6,119 +6,126 @@
* VolumeManager is responsible for tracking list of mounted volumes. * VolumeManager is responsible for tracking list of mounted volumes.
* @interface * @interface
*/ */
function VolumeManager() {} class VolumeManager {
constructor() {
/** /**
* The list of VolumeInfo instances for each mounted volume. * The list of VolumeInfo instances for each mounted volume.
* @type {VolumeInfoList} * @type {VolumeInfoList}
*/ */
VolumeManager.prototype.volumeInfoList; this.volumeInfoList;
}
/**
* Obtains a volume info containing the passed entry. /**
* @param {!Entry|!FilesAppEntry} entry Entry on the volume to be * Disposes the instance. After the invocation of this method, any other
* returned. Can be fake. * method should not be called.
* @return {VolumeInfo} The VolumeInfo instance or null if not found. */
*/ dispose() {}
VolumeManager.prototype.getVolumeInfo;
/**
/** * Obtains a volume info containing the passed entry.
* Returns the drive connection state. * @param {!Entry|!FilesAppEntry} entry Entry on the volume to be
* @return {VolumeManagerCommon.DriveConnectionState} Connection state. * returned. Can be fake.
*/ * @return {VolumeInfo} The VolumeInfo instance or null if not found.
VolumeManager.prototype.getDriveConnectionState = function() {}; */
getVolumeInfo(entry) {}
/**
* @param {string} fileUrl File url to the archive file. /**
* @param {function(VolumeInfo)} successCallback Success callback. * Returns the drive connection state.
* @param {function(VolumeManagerCommon.VolumeError)} errorCallback Error * @return {VolumeManagerCommon.DriveConnectionState} Connection state.
* callback. */
*/ getDriveConnectionState() {}
VolumeManager.prototype.mountArchive =
function(fileUrl, successCallback, errorCallback) {}; /**
* @param {string} fileUrl File url to the archive file.
/** * @param {function(VolumeInfo)} successCallback Success callback.
* Unmounts a volume. * @param {function(VolumeManagerCommon.VolumeError)} errorCallback Error
* @param {!VolumeInfo} volumeInfo Volume to be unmounted. * callback.
* @param {function()} successCallback Success callback. */
* @param {function(VolumeManagerCommon.VolumeError)} errorCallback Error mountArchive(fileUrl, successCallback, errorCallback) {}
* callback.
*/ /**
VolumeManager.prototype.unmount = * Unmounts a volume.
function(volumeInfo, successCallback, errorCallback) {}; * @param {!VolumeInfo} volumeInfo Volume to be unmounted.
* @param {function()} successCallback Success callback.
/** * @param {function(VolumeManagerCommon.VolumeError)} errorCallback Error
* Configures a volume. * callback.
* @param {!VolumeInfo} volumeInfo Volume to be configured. */
* @return {!Promise} Fulfilled on success, otherwise rejected with an error unmount(volumeInfo, successCallback, errorCallback) {}
* message.
*/ /**
VolumeManager.prototype.configure = function(volumeInfo) {}; * Configures a volume.
* @param {!VolumeInfo} volumeInfo Volume to be configured.
/** * @return {!Promise} Fulfilled on success, otherwise rejected with an error
* Obtains volume information of the current profile. * message.
* */
* @param {VolumeManagerCommon.VolumeType} volumeType Volume type. configure(volumeInfo) {}
* @return {VolumeInfo} Volume info.
*/ /**
VolumeManager.prototype.getCurrentProfileVolumeInfo = function(volumeType) {}; * Obtains volume information of the current profile.
*
/** * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
* Obtains location information from an entry. * @return {VolumeInfo} Volume info.
* */
* @param {!Entry|!FilesAppEntry} entry File or directory entry. It getCurrentProfileVolumeInfo(volumeType) {}
* can be a fake entry.
* @return {EntryLocation} Location information. /**
*/ * Obtains location information from an entry.
VolumeManager.prototype.getLocationInfo = function(entry) {}; *
* @param {!Entry|!FilesAppEntry} entry File or directory entry. It
/** * can be a fake entry.
* Adds an event listener to the target. * @return {EntryLocation} Location information.
* @param {string} type The name of the event. */
* @param {function(!Event)} handler The handler for the event. This is getLocationInfo(entry) {}
* called when the event is dispatched.
*/ /**
VolumeManager.prototype.addEventListener = function(type, handler) {}; * Adds an event listener to the target.
* @param {string} type The name of the event.
/** * @param {function(!Event)} handler The handler for the event. This is
* Removes an event listener from the target. * called when the event is dispatched.
* @param {string} type The name of the event. */
* @param {function(!Event)} handler The handler for the event. addEventListener(type, handler) {}
*/
VolumeManager.prototype.removeEventListener = function(type, handler) {}; /**
* Removes an event listener from the target.
/** * @param {string} type The name of the event.
* Dispatches an event and calls all the listeners that are listening to * @param {function(!Event)} handler The handler for the event.
* the type of the event. */
* @param {!Event} event The event to dispatch. removeEventListener(type, handler) {}
* @return {boolean} Whether the default action was prevented. If someone
* calls preventDefault on the event object then this returns false. /**
*/ * Dispatches an event and calls all the listeners that are listening to
VolumeManager.prototype.dispatchEvent = function(event) {}; * the type of the event.
* @param {!Event} event The event to dispatch.
/** * @return {boolean} Whether the default action was prevented. If someone
* Searches the information of the volume that exists on the given device path. * calls preventDefault on the event object then this returns false.
* @param {string} devicePath Path of the device to search. */
* @return {VolumeInfo} The volume's information, or null if not found. dispatchEvent(event) {}
*/
VolumeManager.prototype.findByDevicePath = function(devicePath) {}; /**
* Searches the information of the volume that exists on the given device
/** * path.
* Returns a promise that will be resolved when volume info, identified * @param {string} devicePath Path of the device to search.
* by {@code volumeId} is created. * @return {VolumeInfo} The volume's information, or null if not found.
* */
* @param {string} volumeId findByDevicePath(devicePath) {}
* @return {!Promise<!VolumeInfo>} The VolumeInfo. Will not resolve
* if the volume is never mounted. /**
*/ * Returns a promise that will be resolved when volume info, identified
VolumeManager.prototype.whenVolumeInfoReady = function(volumeId) {}; * by {@code volumeId} is created.
*
/** * @param {string} volumeId
* Obtains the default display root entry. * @return {!Promise<!VolumeInfo>} The VolumeInfo. Will not resolve
* @param {function(DirectoryEntry)|function(FilesAppDirEntry)} callback * if the volume is never mounted.
* Callback passed the default display root. */
*/ whenVolumeInfoReady(volumeId) {}
VolumeManager.prototype.getDefaultDisplayRoot = function(callback) {};
/**
* Obtains the default display root entry.
* @param {function(DirectoryEntry)|function(FilesAppDirEntry)} callback
* Callback passed the default display root.
*/
getDefaultDisplayRoot(callback) {}
}
/** /**
* Event object which is dispached with 'externally-unmounted' event. * Event object which is dispached with 'externally-unmounted' event.
......
...@@ -4,68 +4,67 @@ ...@@ -4,68 +4,67 @@
/** /**
* The container of the VolumeInfo for each mounted volume. * The container of the VolumeInfo for each mounted volume.
* @constructor * @final
* @implements {VolumeInfoList} * @implements {VolumeInfoList}
*/ */
function VolumeInfoListImpl() { class VolumeInfoListImpl {
/** constructor() {
* Holds VolumeInfo instances. /**
* @type {cr.ui.ArrayDataModel} * Holds VolumeInfo instances.
* @private * @private @const {cr.ui.ArrayDataModel}
*/ */
this.model_ = new cr.ui.ArrayDataModel([]); this.model_ = new cr.ui.ArrayDataModel([]);
Object.freeze(this); Object.freeze(this);
} }
VolumeInfoListImpl.prototype = {
get length() { get length() {
return this.model_.length; return this.model_.length;
} }
};
/** @override */ /** @override */
VolumeInfoListImpl.prototype.addEventListener = function(type, handler) { addEventListener(type, handler) {
this.model_.addEventListener(type, handler); this.model_.addEventListener(type, handler);
}; }
/** @override */ /** @override */
VolumeInfoListImpl.prototype.removeEventListener = function(type, handler) { removeEventListener(type, handler) {
this.model_.removeEventListener(type, handler); this.model_.removeEventListener(type, handler);
}; }
/** @override */ /** @override */
VolumeInfoListImpl.prototype.add = function(volumeInfo) { add(volumeInfo) {
const index = this.findIndex(volumeInfo.volumeId); const index = this.findIndex(volumeInfo.volumeId);
if (index !== -1) { if (index !== -1) {
this.model_.splice(index, 1, volumeInfo); this.model_.splice(index, 1, volumeInfo);
} else { } else {
this.model_.push(volumeInfo); this.model_.push(volumeInfo);
}
} }
};
/** @override */ /** @override */
VolumeInfoListImpl.prototype.remove = function(volumeId) { remove(volumeId) {
const index = this.findIndex(volumeId); const index = this.findIndex(volumeId);
if (index !== -1) { if (index !== -1) {
this.model_.splice(index, 1); this.model_.splice(index, 1);
}
} }
};
/** @override */ /** @override */
VolumeInfoListImpl.prototype.item = function(index) { item(index) {
return /** @type {!VolumeInfo} */ (this.model_.item(index)); return /** @type {!VolumeInfo} */ (this.model_.item(index));
}; }
/** /**
* Obtains an index from the volume ID. * Obtains an index from the volume ID.
* @param {string} volumeId Volume ID. * @param {string} volumeId Volume ID.
* @return {number} Index of the volume. * @return {number} Index of the volume.
*/ */
VolumeInfoListImpl.prototype.findIndex = function(volumeId) { findIndex(volumeId) {
for (let i = 0; i < this.model_.length; i++) { for (let i = 0; i < this.model_.length; i++) {
if (this.model_.item(i).volumeId === volumeId) { if (this.model_.item(i).volumeId === volumeId) {
return i; return i;
}
} }
return -1;
} }
return -1; }
};
...@@ -6,12 +6,12 @@ var volumeManagerFactory = (() => { ...@@ -6,12 +6,12 @@ var volumeManagerFactory = (() => {
/** /**
* The singleton instance of VolumeManager. Initialized by the first * The singleton instance of VolumeManager. Initialized by the first
* invocation of getInstance(). * invocation of getInstance().
* @type {VolumeManager} * @type {?VolumeManagerImpl}
*/ */
let instance = null; let instance = null;
/** /**
* @type {Promise} * @type {?Promise<!VolumeManager>}
*/ */
let instancePromise = null; let instancePromise = null;
...@@ -22,16 +22,14 @@ var volumeManagerFactory = (() => { ...@@ -22,16 +22,14 @@ var volumeManagerFactory = (() => {
* @param {function(VolumeManager)=} opt_callback Called with the * @param {function(VolumeManager)=} opt_callback Called with the
* VolumeManager instance. TODO(hirono): Remove the callback and use * VolumeManager instance. TODO(hirono): Remove the callback and use
* Promise instead. * Promise instead.
* @return {Promise} Promise to be fulfilled with the volume manager. * @return {!Promise<!VolumeManager>} Promise to be fulfilled with the volume
* manager.
*/ */
function getInstance(opt_callback) { function getInstance(opt_callback) {
if (!instancePromise) { if (!instancePromise) {
instance = new VolumeManagerImpl(); instance = new VolumeManagerImpl();
instancePromise = new Promise(fulfill => { instancePromise =
instance.initialize_(() => { new Promise(fulfill => instance.initialize(() => fulfill(instance)));
return fulfill(instance);
});
});
} }
if (opt_callback) { if (opt_callback) {
instancePromise.then(opt_callback); instancePromise.then(opt_callback);
......
...@@ -46,6 +46,9 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -46,6 +46,9 @@ class VolumeManagerImpl extends cr.EventTarget {
this.onDriveConnectionStatusChanged_(); this.onDriveConnectionStatusChanged_();
} }
/** @override */
dispose() {}
/** /**
* Invoked when the drive connection status is changed. * Invoked when the drive connection status is changed.
* @private * @private
...@@ -122,9 +125,8 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -122,9 +125,8 @@ class VolumeManagerImpl extends cr.EventTarget {
* Initializes mount points. * Initializes mount points.
* @param {function()} callback Called upon the completion of the * @param {function()} callback Called upon the completion of the
* initialization. * initialization.
* @private
*/ */
initialize_(callback) { initialize(callback) {
chrome.fileManagerPrivate.onMountCompleted.addListener( chrome.fileManagerPrivate.onMountCompleted.addListener(
this.onMountCompleted_.bind(this)); this.onMountCompleted_.bind(this));
console.warn('Requesting volume list.'); console.warn('Requesting volume list.');
...@@ -277,8 +279,8 @@ class VolumeManagerImpl extends cr.EventTarget { ...@@ -277,8 +279,8 @@ class VolumeManagerImpl extends cr.EventTarget {
return volumeInfo; return volumeInfo;
} }
// Additionally, check fake entries. // Additionally, check fake entries.
for (let key in volumeInfo.fakeEntries_) { for (let key in volumeInfo.fakeEntries) {
const fakeEntry = volumeInfo.fakeEntries_[key]; const fakeEntry = volumeInfo.fakeEntries[key];
if (util.isSameEntry(fakeEntry, entry)) { if (util.isSameEntry(fakeEntry, entry)) {
return volumeInfo; return volumeInfo;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment