OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Thin wrapper for VolumeManager. This should be an interface proxy to talk | 6 * Thin wrapper for VolumeManager. This should be an interface proxy to talk |
7 * to VolumeManager. This class also filters Drive related data/events if | 7 * to VolumeManager. This class also filters Drive related data/events if |
8 * driveEnabled is set to false. | 8 * driveEnabled is set to false. |
9 * | 9 * |
10 * @param {VolumeManagerWrapper.DriveEnabledStatus} driveEnabled DRIVE_ENABLED | 10 * @param {VolumeManagerWrapper.DriveEnabledStatus} driveEnabled DRIVE_ENABLED |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 callback(); | 198 callback(); |
199 }; | 199 }; |
200 | 200 |
201 /** | 201 /** |
202 * @return {util.DriveConnectionType} Current drive connection state. | 202 * @return {util.DriveConnectionType} Current drive connection state. |
203 */ | 203 */ |
204 VolumeManagerWrapper.prototype.getDriveConnectionState = function() { | 204 VolumeManagerWrapper.prototype.getDriveConnectionState = function() { |
205 if (!this.driveEnabled_ || !this.volumeManager_) { | 205 if (!this.driveEnabled_ || !this.volumeManager_) { |
206 return { | 206 return { |
207 type: util.DriveConnectionType.OFFLINE, | 207 type: util.DriveConnectionType.OFFLINE, |
208 reasons: [util.DriveConnectionReason.NO_SERVICE] | 208 reason: util.DriveConnectionReason.NO_SERVICE |
209 }; | 209 }; |
210 } | 210 } |
211 | 211 |
212 return this.volumeManager_.getDriveConnectionState(); | 212 return this.volumeManager_.getDriveConnectionState(); |
213 }; | 213 }; |
214 | 214 |
215 /** | 215 /** |
216 * @param {string} mountPath The path to mount location of the volume. | 216 * @param {string} mountPath The path to mount location of the volume. |
217 * @return {VolumeInfo} The VolumeInfo instance for the volume mounted at | 217 * @return {VolumeInfo} The VolumeInfo instance for the volume mounted at |
218 * mountPath, or null if no volume is found | 218 * mountPath, or null if no volume is found |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 * @param {VolumeInfo} volumeInfo Volume info. | 325 * @param {VolumeInfo} volumeInfo Volume info. |
326 * @return {VolumeInfo} Null if the drive is disabled and the given volume is | 326 * @return {VolumeInfo} Null if the drive is disabled and the given volume is |
327 * drive. Otherwise just returns the volume. | 327 * drive. Otherwise just returns the volume. |
328 * @private | 328 * @private |
329 */ | 329 */ |
330 VolumeManagerWrapper.prototype.filterDisabledDriveVolume_ = | 330 VolumeManagerWrapper.prototype.filterDisabledDriveVolume_ = |
331 function(volumeInfo) { | 331 function(volumeInfo) { |
332 var isDrive = volumeInfo && volumeInfo.volumeType === util.VolumeType.DRIVE; | 332 var isDrive = volumeInfo && volumeInfo.volumeType === util.VolumeType.DRIVE; |
333 return this.driveEnabled_ || !isDrive ? volumeInfo : null; | 333 return this.driveEnabled_ || !isDrive ? volumeInfo : null; |
334 }; | 334 }; |
OLD | NEW |