Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/volume_manager.js |
| diff --git a/chrome/browser/resources/file_manager/js/volume_manager.js b/chrome/browser/resources/file_manager/js/volume_manager.js |
| index 695bef12ff98e998e5d96d722c4dd14c177c051c..f7c681d38cf31dc4ff3148eb209765df8f9aba63 100644 |
| --- a/chrome/browser/resources/file_manager/js/volume_manager.js |
| +++ b/chrome/browser/resources/file_manager/js/volume_manager.js |
| @@ -61,6 +61,16 @@ VolumeManager.GDataStatus = { |
| }; |
| /** |
| + * @enum |
| + */ |
| +VolumeManager.MountType = { |
| + DEVICE: 'device', |
| + FILE: 'file', |
| + NETWORK: 'network', |
| + DRIVE: 'drive' |
| +}; |
|
satorux1
2012/11/26 05:50:40
Looks like a good cleanup, but I think we should d
yoshiki
2012/11/26 06:07:22
Got it, I'll do that at another CL.
|
| + |
| +/** |
| * Time in milliseconds that we wait a respone for. If no response on |
| * mount/unmount received the request supposed failed. |
| */ |
| @@ -119,7 +129,7 @@ VolumeManager.prototype.initMountPoints_ = function() { |
| function step(mountPoints) { |
| if (index < mountPoints.length) { |
| var info = mountPoints[index]; |
| - if (info.mountType == 'gdata') |
| + if (info.mountType == VolumeManager.MountType.DRIVE) |
| console.error('GData is not expected initially mounted'); |
| var error = info.mountCondition ? 'error_' + info.mountCondition : ''; |
| function onVolumeInfo(volume) { |
| @@ -197,7 +207,7 @@ VolumeManager.prototype.onMountCompleted_ = function(event) { |
| } |
| } |
| - if (event.mountType == 'gdata') { |
| + if (event.mountType == VolumeManager.MountType.DRIVE) { |
| if (event.status == 'success') { |
| if (event.eventType == 'mount') { |
| // If the mount is not requested, the mount status will not be changed |
| @@ -290,7 +300,7 @@ VolumeManager.prototype.mountGData = function(successCallback, errorCallback) { |
| this.setGDataStatus_(VolumeManager.GDataStatus.UNMOUNTED); |
| } |
| var self = this; |
| - this.mount_('', 'gdata', function(mountPath) { |
| + this.mount_('', VolumeManager.MountType.DRIVE, function(mountPath) { |
| this.waitGDataLoaded_(mountPath, function(success, error) { |
| if (success) { |
| successCallback(mountPath); |
| @@ -312,7 +322,10 @@ VolumeManager.prototype.mountGData = function(successCallback, errorCallback) { |
| */ |
| VolumeManager.prototype.mountArchive = function(fileUrl, successCallback, |
| errorCallback) { |
| - this.mount_(fileUrl, 'file', successCallback, errorCallback); |
| + this.mount_(fileUrl, |
| + VolumeManager.MountType.FILE, |
| + successCallback, |
| + errorCallback); |
| }; |
| /** |