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;
}
/**
* 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() {});
};
/**
- * 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);
};
/**
callback,
function() {
console.error(
- 'Unable to change the watched directory to: ' + entry.toURL());
+ 'Unable to change the watched directory to: ' + entry.toURL());
callback();
});
} else {
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;
}.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();
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) {
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);