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

Unified Diff: ui/file_manager/file_manager/foreground/js/main_window_component.js

Issue 2522403002: Show the leaf folder name as the window name. (Closed)
Patch Set: Style fix. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/main_window_component.js
diff --git a/ui/file_manager/file_manager/foreground/js/main_window_component.js b/ui/file_manager/file_manager/foreground/js/main_window_component.js
index 8c5576b39fa4c45aecc0fe8ea37d450b188954be..ae1a11d326a1bfa05699de943269799b10a6c762 100644
--- a/ui/file_manager/file_manager/foreground/js/main_window_component.js
+++ b/ui/file_manager/file_manager/foreground/js/main_window_component.js
@@ -411,13 +411,22 @@ MainWindowComponent.prototype.onDirectoryChanged_ = function(event) {
this.ui_.element.removeAttribute('unformatted');
}
- // Updates UI.
- if (this.dialogType_ === DialogType.FULL_PAGE && newVolumeInfo)
- document.title = newVolumeInfo.label;
- if (event.newDirEntry)
+ if (event.newDirEntry) {
this.ui_.locationLine.show(event.newDirEntry);
- else
+ // Updates UI.
+ if (this.dialogType_ === DialogType.FULL_PAGE) {
+ var locationInfo = this.volumeManager_.getLocationInfo(event.newDirEntry);
+ if (locationInfo) {
+ document.title = locationInfo.isRootEntry
+ ? util.getRootTypeLabel(locationInfo) : event.newDirEntry.name;
+ } else {
+ console.error('Could not find location info for entry: '
+ + event.newDirEntry.fullPath);
+ }
+ }
+ } else {
this.ui_.locationLine.hide();
+ }
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698