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

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

Issue 7466046: Some filebrowser bugs and retiring DiskChanged event in filebrowser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months 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/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));
- }
- }
};
/**

Powered by Google App Engine
This is Rietveld 408576698