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

Unified Diff: chrome/browser/resources/settings/downloads_page/downloads_page.js

Issue 2608733004: MD Settings: Downloads directory should be relative to Downloads directory. (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/resources/settings/downloads_page/downloads_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ },
});
« no previous file with comments | « chrome/browser/resources/settings/downloads_page/downloads_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698