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

Side by Side 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 3 years, 11 months 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-downloads-page' is the settings page containing downloads 7 * 'settings-downloads-page' is the settings page containing downloads
8 * settings. 8 * settings.
9 * 9 *
10 * Example: 10 * Example:
(...skipping 20 matching lines...) Expand all
31 * Dictionary defining page visibility. 31 * Dictionary defining page visibility.
32 * @type {!DownloadsPageVisibility} 32 * @type {!DownloadsPageVisibility}
33 */ 33 */
34 pageVisibility: Object, 34 pageVisibility: Object,
35 }, 35 },
36 36
37 /** @private */ 37 /** @private */
38 selectDownloadLocation_: function() { 38 selectDownloadLocation_: function() {
39 chrome.send('selectDownloadLocation'); 39 chrome.send('selectDownloadLocation');
40 }, 40 },
41
42 /**
43 * @param {string} path
44 * @return {string} The download location string that is suitable to display
45 * in the UI.
46 * @private
47 */
48 getDownloadLocation_: function(path) {
49 // Replace /special/drive-<hash>/root with "Google Drive" for remote files,
50 // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads with
51 // "Downloads" for local paths, and '/' with ' \u203a ' (angled quote sign)
52 // everywhere. It is used only for display purpose.
53 path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive');
54 path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, '');
55 path = path.replace(/\//g, ' \u203a ');
56 return path;
57 },
41 }); 58 });
OLDNEW
« 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