Index: chrome/browser/resources/file_manager/js/directory_model.js |
diff --git a/chrome/browser/resources/file_manager/js/directory_model.js b/chrome/browser/resources/file_manager/js/directory_model.js |
index cf0bc41cb5557219667fffb2104f59b9537f39a3..ddb4f6c4937ec41415c844b4d3bf00c693eae4e4 100644 |
--- a/chrome/browser/resources/file_manager/js/directory_model.js |
+++ b/chrome/browser/resources/file_manager/js/directory_model.js |
@@ -686,8 +686,13 @@ DirectoryModel.prototype.renameEntry = function(entry, newName, |
var currentDirPath = this.getCurrentDirPath(); |
var onSuccess = function(newEntry) { |
this.currentDirContents_.prefetchMetadata([newEntry], function() { |
- // Do not change anything or call the callback if current |
- // directory changed. |
+ // If the current directory is the old entry, then quietly change to the |
+ // new one. |
+ if (entry.fullPath == this.getCurrentDirPath()) |
+ this.changeDirectory(newEntry.fullPath); |
+ |
+ // Update selection and call the success callback if still in the same |
+ // directory as while started renaming. |
if (currentDirPath != this.getCurrentDirPath()) |
return; |