OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 * @param {Event} event Change event. | 855 * @param {Event} event Change event. |
856 * @private | 856 * @private |
857 */ | 857 */ |
858 onDefaultDownloadDirectoryChanged_: function(event) { | 858 onDefaultDownloadDirectoryChanged_: function(event) { |
859 $('downloadLocationPath').value = event.value.value; | 859 $('downloadLocationPath').value = event.value.value; |
860 if (cr.isChromeOS) { | 860 if (cr.isChromeOS) { |
861 // On ChromeOS, replace /special/drive with Drive for drive paths, and | 861 // On ChromeOS, replace /special/drive with Drive for drive paths, and |
862 // /home/chronos/user/Downloads with Downloads for local files. | 862 // /home/chronos/user/Downloads with Downloads for local files. |
863 // Also replace '/' with ' \u203a ' (angled quote sign) everywhere. | 863 // Also replace '/' with ' \u203a ' (angled quote sign) everywhere. |
864 var path = $('downloadLocationPath').value; | 864 var path = $('downloadLocationPath').value; |
865 path = path.replace(/^\/special\/drive/, 'Google Drive'); | 865 path = path.replace(/^\/special\/drive\/root/, 'Google Drive'); |
866 path = path.replace(/^\/home\/chronos\/user\//, ''); | 866 path = path.replace(/^\/home\/chronos\/user\//, ''); |
867 path = path.replace(/\//g, ' \u203a '); | 867 path = path.replace(/\//g, ' \u203a '); |
868 $('downloadLocationPath').value = path; | 868 $('downloadLocationPath').value = path; |
869 } | 869 } |
870 if (event.value.disabled) | 870 if (event.value.disabled) |
871 $('download-location-label').classList.add('disabled'); | 871 $('download-location-label').classList.add('disabled'); |
872 else | 872 else |
873 $('download-location-label').classList.remove('disabled'); | 873 $('download-location-label').classList.remove('disabled'); |
874 $('downloadLocationChangeButton').disabled = event.value.disabled; | 874 $('downloadLocationChangeButton').disabled = event.value.disabled; |
875 }, | 875 }, |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 BrowserOptions.getLoggedInUsername = function() { | 1440 BrowserOptions.getLoggedInUsername = function() { |
1441 return BrowserOptions.getInstance().username_; | 1441 return BrowserOptions.getInstance().username_; |
1442 }; | 1442 }; |
1443 } | 1443 } |
1444 | 1444 |
1445 // Export | 1445 // Export |
1446 return { | 1446 return { |
1447 BrowserOptions: BrowserOptions | 1447 BrowserOptions: BrowserOptions |
1448 }; | 1448 }; |
1449 }); | 1449 }); |
OLD | NEW |