Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / ui / file_manager / file_manager / foreground / js / file_watcher.js
index d62bbfd..d55af87 100644 (file)
@@ -18,12 +18,12 @@ function FileWatcher(metadataCache) {
   this.watchedDirectoryEntry_ = null;
 
   this.onDirectoryChangedBound_ = this.onDirectoryChanged_.bind(this);
-  chrome.fileBrowserPrivate.onDirectoryChanged.addListener(
+  chrome.fileManagerPrivate.onDirectoryChanged.addListener(
       this.onDirectoryChangedBound_);
 
   this.filesystemMetadataObserverId_ = null;
   this.thumbnailMetadataObserverId_ = null;
-  this.driveMetadataObserverId_ = null;
+  this.externalMetadataObserverId_ = null;
 }
 
 /**
@@ -35,7 +35,7 @@ FileWatcher.prototype.__proto__ = cr.EventTarget.prototype;
  * Stops watching (must be called before page unload).
  */
 FileWatcher.prototype.dispose = function() {
-  chrome.fileBrowserPrivate.onDirectoryChanged.removeListener(
+  chrome.fileManagerPrivate.onDirectoryChanged.removeListener(
       this.onDirectoryChangedBound_);
   if (this.watchedDirectoryEntry_)
     this.resetWatchedEntry_(function() {}, function() {});
@@ -82,16 +82,16 @@ FileWatcher.prototype.onThumbnailMetadataChanged_ = function(
 };
 
 /**
- * Called when drive metadata in the watched directory has been changed.
+ * Called when external metadata in the watched directory has been changed.
  *
  * @param {Array.<Entry>} entries Array of entries.
  * @param {Object.<string, Object>} properties Map from entry URLs to metadata
  *     properties.
  * @private
  */
-FileWatcher.prototype.onDriveMetadataChanged_ = function(
+FileWatcher.prototype.onExternalMetadataChanged_ = function(
     entries, properties) {
-  this.dispatchMetadataEvent_('drive', entries, properties);
+  this.dispatchMetadataEvent_('external', entries, properties);
 };
 
 /**
@@ -128,7 +128,7 @@ FileWatcher.prototype.changeWatchedDirectory = function(entry, callback) {
         callback,
         function() {
           console.error(
-             'Unable to change the watched directory to: ' + entry.toURL());
+              'Unable to change the watched directory to: ' + entry.toURL());
           callback();
         });
   } else {
@@ -153,7 +153,7 @@ FileWatcher.prototype.resetWatchedEntry_ = function(onSuccess, onError) {
   this.queue_.run(function(callback) {
     // Release the watched directory.
     if (this.watchedDirectoryEntry_) {
-      chrome.fileBrowserPrivate.removeFileWatch(
+      chrome.fileManagerPrivate.removeFileWatch(
           this.watchedDirectoryEntry_.toURL(),
           function(result) {
             this.watchedDirectoryEntry_ = null;
@@ -165,7 +165,7 @@ FileWatcher.prototype.resetWatchedEntry_ = function(onSuccess, onError) {
           }.bind(this));
       this.metadataCache_.removeObserver(this.filesystemMetadataObserverId_);
       this.metadataCache_.removeObserver(this.thumbnailMetadataObserverId_);
-      this.metadataCache_.removeObserver(this.driveMetadataObserverId_);
+      this.metadataCache_.removeObserver(this.externalMetadataObserverId_);
     } else {
       onSuccess();
       callback();
@@ -186,7 +186,7 @@ FileWatcher.prototype.changeWatchedEntry_ = function(
   var setEntryClosure = function() {
     // Run the tasks in the queue to avoid races.
     this.queue_.run(function(callback) {
-      chrome.fileBrowserPrivate.addFileWatch(
+      chrome.fileManagerPrivate.addFileWatch(
           entry.toURL(),
           function(result) {
             if (!result) {
@@ -199,20 +199,20 @@ FileWatcher.prototype.changeWatchedEntry_ = function(
             callback();
           }.bind(this));
       this.filesystemMetadataObserverId_ = this.metadataCache_.addObserver(
-        entry,
-        MetadataCache.CHILDREN,
-        'filesystem',
-        this.onFilesystemMetadataChanged_.bind(this));
+          entry,
+          MetadataCache.CHILDREN,
+          'filesystem',
+          this.onFilesystemMetadataChanged_.bind(this));
       this.thumbnailMetadataObserverId_ = this.metadataCache_.addObserver(
-        entry,
-        MetadataCache.CHILDREN,
-        'thumbnail',
-        this.onThumbnailMetadataChanged_.bind(this));
-      this.driveMetadataObserverId_ = this.metadataCache_.addObserver(
-        entry,
-        MetadataCache.CHILDREN,
-        'drive',
-        this.onDriveMetadataChanged_.bind(this));
+          entry,
+          MetadataCache.CHILDREN,
+          'thumbnail',
+          this.onThumbnailMetadataChanged_.bind(this));
+      this.externalMetadataObserverId_ = this.metadataCache_.addObserver(
+          entry,
+          MetadataCache.CHILDREN,
+          'external',
+          this.onExternalMetadataChanged_.bind(this));
     }.bind(this));
   }.bind(this);