Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/file_manager.js |
| =================================================================== |
| --- chrome/browser/resources/file_manager/js/file_manager.js (revision 95911) |
| +++ chrome/browser/resources/file_manager/js/file_manager.js (working copy) |
| @@ -1637,9 +1637,18 @@ |
| } |
| } |
| } |
| + |
| + if (event.eventType == 'unmount' && event.status == 'success' && |
| + self.currentDirEntry_ && |
| + isParentPath(event.mountPath, self.currentDirEntry_.fullPath)) { |
| + self.changeDirectory(getParentPath(event.mountPath)); |
| + return; |
| + } |
| + |
| // TODO(dgozman): rescan directory, only if it contains mounted points, |
| // when mounts location will be decided. |
| - this.rescanDirectory_(); |
| + if (event.status == 'success') |
| + self.rescanDirectory_(); |
| }); |
| }; |
| @@ -2371,15 +2380,6 @@ |
| * @param {string} path The path that has been mounted or unmounted. |
| */ |
| FileManager.prototype.onDiskChanged_ = function(event) { |
|
zel
2011/08/09 00:09:45
why don't we remove this?
tbarzic
2011/08/09 00:35:07
Done.
|
| - if (event.eventType == 'added') { |
| - this.changeDirectory(event.volumeInfo.mountPath); |
| - } else if (event.eventType == 'removed') { |
| - if (this.currentDirEntry_ && |
| - isParentPath(event.volumeInfo.mountPath, |
| - this.currentDirEntry_.fullPath)) { |
| - this.changeDirectory(getParentPath(event.volumeInfo.mountPath)); |
| - } |
| - } |
| }; |
| /** |