| Index: chrome/browser/resources/settings/downloads_page/downloads_page.js
|
| diff --git a/chrome/browser/resources/settings/downloads_page/downloads_page.js b/chrome/browser/resources/settings/downloads_page/downloads_page.js
|
| index f390ee7bda2d9259e78c4812db201f3cbecef2e1..7603dad8f7812eeeba7c08cb3f97d580e44eb6a2 100644
|
| --- a/chrome/browser/resources/settings/downloads_page/downloads_page.js
|
| +++ b/chrome/browser/resources/settings/downloads_page/downloads_page.js
|
| @@ -38,4 +38,21 @@ Polymer({
|
| selectDownloadLocation_: function() {
|
| chrome.send('selectDownloadLocation');
|
| },
|
| +
|
| + /**
|
| + * @param {string} path
|
| + * @return {string} The download location string that is suitable to display
|
| + * in the UI.
|
| + * @private
|
| + */
|
| + getDownloadLocation_: function(path) {
|
| + // Replace /special/drive-<hash>/root with "Google Drive" for remote files,
|
| + // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads with
|
| + // "Downloads" for local paths, and '/' with ' \u203a ' (angled quote sign)
|
| + // everywhere. It is used only for display purpose.
|
| + path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive');
|
| + path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, '');
|
| + path = path.replace(/\//g, ' \u203a ');
|
| + return path;
|
| + },
|
| });
|
|
|