Commit c535bf0b authored by yoshiki@chromium.org's avatar yoshiki@chromium.org

[Files.app] Fix small bugs in file_watcher.js

This patch fixes the clear bugs in file_watcher.js.

BUG=288420
TEST=none

Review URL: https://chromiumcodereview.appspot.com/23523042

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222253 0039d316-1c4b-4281-b951-d872f2087c98
parent 379d4c2d
...@@ -47,7 +47,8 @@ FileWatcher.prototype.dispose = function() { ...@@ -47,7 +47,8 @@ FileWatcher.prototype.dispose = function() {
* @private * @private
*/ */
FileWatcher.prototype.onDirectoryChanged_ = function(event) { FileWatcher.prototype.onDirectoryChanged_ = function(event) {
if (event.directoryUrl == this.watchedDirectoryEntry_.toURL()) { if (this.watchedDirectoryEntry_ &&
event.directoryUrl == this.watchedDirectoryEntry_.toURL()) {
var e = new cr.Event('watcher-directory-changed'); var e = new cr.Event('watcher-directory-changed');
this.dispatchEvent(e); this.dispatchEvent(e);
} }
...@@ -160,7 +161,7 @@ FileWatcher.prototype.resetWatchedEntry_ = function(onSuccess, onError) { ...@@ -160,7 +161,7 @@ FileWatcher.prototype.resetWatchedEntry_ = function(onSuccess, onError) {
else else
onError(); onError();
callback(); callback();
}); }.bind(this));
this.metadataCache_.removeObserver(this.filesystemMetadataObserverId_); this.metadataCache_.removeObserver(this.filesystemMetadataObserverId_);
this.metadataCache_.removeObserver(this.thumbnailMetadataObserverId_); this.metadataCache_.removeObserver(this.thumbnailMetadataObserverId_);
this.metadataCache_.removeObserver(this.driveMetadataObserverId_); this.metadataCache_.removeObserver(this.driveMetadataObserverId_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment