OLD | NEW |
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 21 matching lines...) Expand all Loading... |
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 | 41 |
42 <if expr="chromeos"> | 42 // <if expr="chromeos"> |
43 /** | 43 /** |
44 * @param {string} path | 44 * @param {string} path |
45 * @return {string} The download location string that is suitable to display | 45 * @return {string} The download location string that is suitable to display |
46 * in the UI. | 46 * in the UI. |
47 * @private | 47 * @private |
48 */ | 48 */ |
49 getDownloadLocation_: function(path) { | 49 getDownloadLocation_: function(path) { |
50 // Replace /special/drive-<hash>/root with "Google Drive" for remote files, | 50 // Replace /special/drive-<hash>/root with "Google Drive" for remote files, |
51 // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads with | 51 // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads with |
52 // "Downloads" for local paths, and '/' with ' \u203a ' (angled quote sign) | 52 // "Downloads" for local paths, and '/' with ' \u203a ' (angled quote sign) |
53 // everywhere. It is used only for display purpose. | 53 // everywhere. It is used only for display purpose. |
54 path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive'); | 54 path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive'); |
55 path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, ''); | 55 path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, ''); |
56 path = path.replace(/\//g, ' \u203a '); | 56 path = path.replace(/\//g, ' \u203a '); |
57 return path; | 57 return path; |
58 }, | 58 }, |
59 </if> | 59 // </if> |
60 }); | 60 }); |
OLD | NEW |