Commit e0ee32e4 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Prefix the files app document title with its localised name.

For example, when viewing Downloads, the title in English would be
"Files - Downloads".

Bug: 762691
Change-Id: Icb9047da7f5e635db2c845d15e98a3165286689f
Reviewed-on: https://chromium-review.googlesource.com/c/1345712
Commit-Queue: Sam McNally <sammc@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609923}
parent 4428eafa
...@@ -828,6 +828,7 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() { ...@@ -828,6 +828,7 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() {
IDS_FILE_BROWSER_ZIP_TARGET_EXISTS_ERROR); IDS_FILE_BROWSER_ZIP_TARGET_EXISTS_ERROR);
SET_STRING("ZIP_UNEXPECTED_ERROR", IDS_FILE_BROWSER_ZIP_UNEXPECTED_ERROR); SET_STRING("ZIP_UNEXPECTED_ERROR", IDS_FILE_BROWSER_ZIP_UNEXPECTED_ERROR);
SET_STRING("SEE_MENU_FOR_ACTIONS", IDS_FILE_BROWSER_SEE_MENU_FOR_ACTIONS); SET_STRING("SEE_MENU_FOR_ACTIONS", IDS_FILE_BROWSER_SEE_MENU_FOR_ACTIONS);
SET_STRING("FILEMANAGER_APP_NAME", IDS_FILEMANAGER_APP_NAME);
#undef SET_STRING #undef SET_STRING
dict->SetBoolean("PDF_VIEW_ENABLED", dict->SetBoolean("PDF_VIEW_ENABLED",
......
...@@ -1214,7 +1214,7 @@ util.getRootTypeLabel = function(locationInfo) { ...@@ -1214,7 +1214,7 @@ util.getRootTypeLabel = function(locationInfo) {
* Returns the localized name of the entry. * Returns the localized name of the entry.
* *
* @param {EntryLocation} locationInfo * @param {EntryLocation} locationInfo
* @param {!Entry} entry The entry to be retrieve the name of. * @param {!Entry|!FakeEntry} entry The entry to be retrieve the name of.
* @return {?string} The localized name. * @return {?string} The localized name.
*/ */
util.getEntryLabel = function(locationInfo, entry) { util.getEntryLabel = function(locationInfo, entry) {
......
...@@ -455,9 +455,8 @@ MainWindowComponent.prototype.onDirectoryChanged_ = function(event) { ...@@ -455,9 +455,8 @@ MainWindowComponent.prototype.onDirectoryChanged_ = function(event) {
if (this.dialogType_ === DialogType.FULL_PAGE) { if (this.dialogType_ === DialogType.FULL_PAGE) {
var locationInfo = this.volumeManager_.getLocationInfo(event.newDirEntry); var locationInfo = this.volumeManager_.getLocationInfo(event.newDirEntry);
if (locationInfo) { if (locationInfo) {
document.title = locationInfo.hasFixedLabel ? const label = util.getEntryLabel(locationInfo, event.newDirEntry);
util.getRootTypeLabel(locationInfo) : document.title = `${str('FILEMANAGER_APP_NAME')} - ${label}`;
event.newDirEntry.name;
} else { } else {
console.error('Could not find location info for entry: ' console.error('Could not find location info for entry: '
+ event.newDirEntry.fullPath); + event.newDirEntry.fullPath);
......
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