Commit 8fff1adc authored by mtomasz@chromium.org's avatar mtomasz@chromium.org

Fix titles of Files app windows.

Currently, the title was one behind, because the title was being updated before the current volume was remembered to a member variable. This patch resolves this issue by storing the current volume to a member variable ASAP.

TEST=Tested manually with two windows.
BUG=339015

Review URL: https://codereview.chromium.org/145123005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247740 0039d316-1c4b-4281-b951-d872f2087c98
parent a66e18e7
......@@ -2283,6 +2283,21 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.onDirectoryChanged_ = function(event) {
var newCurrentVolumeInfo = this.volumeManager_.getVolumeInfo(
event.newDirEntry);
// If volume has changed, then update the gear menu.
if (this.currentVolumeInfo_ !== newCurrentVolumeInfo) {
this.updateGearMenu_();
// If the volume has changed, and it was previously set, then do not
// close on unmount anymore.
if (this.currentVolumeInfo_)
this.closeOnUnmount_ = false;
}
// Remember the current volume info.
this.currentVolumeInfo_ = newCurrentVolumeInfo;
this.selectionHandler_.onFileSelectionChanged();
this.ui_.searchBox.clear();
// TODO(mtomasz): Use Entry.toURL() instead of fullPath.
......@@ -2298,24 +2313,10 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.updateUnformattedVolumeStatus_();
this.updateTitle_();
var newCurrentVolumeInfo = this.volumeManager_.getVolumeInfo(
event.newDirEntry);
// If volume has changed, then update the gear menu.
if (this.currentVolumeInfo_ !== newCurrentVolumeInfo) {
this.updateGearMenu_();
// If the volume has changed, and it was previously set, then do not
// close on unmount anymore.
if (this.currentVolumeInfo_)
this.closeOnUnmount_ = false;
}
var currentEntry = this.getCurrentDirectoryEntry();
this.previewPanel_.currentEntry = util.isFakeEntry(currentEntry) ?
null : currentEntry;
// Remember the current volume info.
this.currentVolumeInfo_ = newCurrentVolumeInfo;
};
FileManager.prototype.updateUnformattedVolumeStatus_ = function() {
......
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