Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1820)

Unified Diff: chrome/browser/resources/file_manager/js/volume_manager.js

Issue 11414152: Drive: Rename GData to Drive in extension JS API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Change 'gdata' to 'drive' of mount type. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
/**

Powered by Google App Engine
This is Rietveld 408576698