| 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 * VolumeManager is responsible for tracking list of mounted volumes. | 6 * VolumeManager is responsible for tracking list of mounted volumes. |
| 7 * | 7 * |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {cr.EventTarget} | 9 * @extends {cr.EventTarget} |
| 10 */ | 10 */ |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 */ | 341 */ |
| 342 VolumeManager.prototype.isUnreadable = function(mountPath) { | 342 VolumeManager.prototype.isUnreadable = function(mountPath) { |
| 343 var error = this.getMountError(mountPath); | 343 var error = this.getMountError(mountPath); |
| 344 return error == VolumeManager.Error.UNKNOWN_FILESYSTEM || | 344 return error == VolumeManager.Error.UNKNOWN_FILESYSTEM || |
| 345 error == VolumeManager.Error.UNSUPPORTED_FILESYSTEM; | 345 error == VolumeManager.Error.UNSUPPORTED_FILESYSTEM; |
| 346 }; | 346 }; |
| 347 | 347 |
| 348 /** | 348 /** |
| 349 * @param {string} mountPath Volume mounted path. | 349 * @param {string} mountPath Volume mounted path. |
| 350 * @return {string} Device type ('usb'|'sd'|'optical'|'mobile'|'unknown') | 350 * @return {string} Device type ('usb'|'sd'|'optical'|'mobile'|'unknown') |
| 351 * (as defined in chrome/browser/chromeos/disks/disk_mount_manager.cc). | 351 * (as defined in chromeos/disks/disk_mount_manager.cc). |
| 352 */ | 352 */ |
| 353 VolumeManager.prototype.getDeviceType = function(mountPath) { | 353 VolumeManager.prototype.getDeviceType = function(mountPath) { |
| 354 return this.getVolumeInfo_(mountPath).deviceType; | 354 return this.getVolumeInfo_(mountPath).deviceType; |
| 355 }; | 355 }; |
| 356 | 356 |
| 357 /** | 357 /** |
| 358 * @param {string} mountPath Volume mounted path. | 358 * @param {string} mountPath Volume mounted path. |
| 359 * @return {boolean} True if volume at |mountedPath| is read only. | 359 * @return {boolean} True if volume at |mountedPath| is read only. |
| 360 */ | 360 */ |
| 361 VolumeManager.prototype.isReadOnly = function(mountPath) { | 361 VolumeManager.prototype.isReadOnly = function(mountPath) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 }; | 484 }; |
| 485 | 485 |
| 486 /** | 486 /** |
| 487 * @param {string} mountPath Mount path. | 487 * @param {string} mountPath Mount path. |
| 488 * @private | 488 * @private |
| 489 */ | 489 */ |
| 490 VolumeManager.prototype.validateMountPath_ = function(mountPath) { | 490 VolumeManager.prototype.validateMountPath_ = function(mountPath) { |
| 491 if (!/^\/(((archive|removable)\/[^\/]+)|drive|Downloads)$/.test(mountPath)) | 491 if (!/^\/(((archive|removable)\/[^\/]+)|drive|Downloads)$/.test(mountPath)) |
| 492 throw new Error('Invalid mount path: ', mountPath); | 492 throw new Error('Invalid mount path: ', mountPath); |
| 493 }; | 493 }; |
| OLD | NEW |