| 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 | 7 |
| 8 /** | 8 /** |
| 9 * ImportDataOverlay class | 9 * ImportDataOverlay class |
| 10 * Encapsulated handling of the 'Import Data' overlay page. | 10 * Encapsulated handling of the 'Import Data' overlay page. |
| 11 * @class | 11 * @class |
| 12 */ | 12 */ |
| 13 function ImportDataOverlay() { | 13 function ImportDataOverlay() { |
| 14 OptionsPage.call(this, | 14 OptionsPage.call(this, |
| 15 'importData', | 15 'importData', |
| 16 templateData.importDataOverlayTabTitle, | 16 loadTimeData.getString('importDataOverlayTabTitle'), |
| 17 'import-data-overlay'); | 17 'import-data-overlay'); |
| 18 } | 18 } |
| 19 | 19 |
| 20 cr.addSingletonGetter(ImportDataOverlay); | 20 cr.addSingletonGetter(ImportDataOverlay); |
| 21 | 21 |
| 22 ImportDataOverlay.prototype = { | 22 ImportDataOverlay.prototype = { |
| 23 // Inherit from OptionsPage. | 23 // Inherit from OptionsPage. |
| 24 __proto__: OptionsPage.prototype, | 24 __proto__: OptionsPage.prototype, |
| 25 | 25 |
| 26 /** | 26 /** |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 * @private | 128 * @private |
| 129 */ | 129 */ |
| 130 updateSupportedBrowsers_: function(browsers) { | 130 updateSupportedBrowsers_: function(browsers) { |
| 131 this.browserProfiles = browsers; | 131 this.browserProfiles = browsers; |
| 132 var browserSelect = $('import-browsers'); | 132 var browserSelect = $('import-browsers'); |
| 133 browserSelect.remove(0); // Remove the 'Loading...' option. | 133 browserSelect.remove(0); // Remove the 'Loading...' option. |
| 134 browserSelect.textContent = ''; | 134 browserSelect.textContent = ''; |
| 135 var browserCount = browsers.length; | 135 var browserCount = browsers.length; |
| 136 | 136 |
| 137 if (browserCount == 0) { | 137 if (browserCount == 0) { |
| 138 var option = new Option(templateData.noProfileFound, 0); | 138 var option = new Option(loadTimeData.getString('noProfileFound'), 0); |
| 139 browserSelect.appendChild(option); | 139 browserSelect.appendChild(option); |
| 140 | 140 |
| 141 this.setControlsSensitive_(false); | 141 this.setControlsSensitive_(false); |
| 142 } else { | 142 } else { |
| 143 this.setControlsSensitive_(true); | 143 this.setControlsSensitive_(true); |
| 144 for (var i = 0; i < browserCount; i++) { | 144 for (var i = 0; i < browserCount; i++) { |
| 145 var browser = browsers[i]; | 145 var browser = browsers[i]; |
| 146 var option = new Option(browser['name'], browser['index']); | 146 var option = new Option(browser['name'], browser['index']); |
| 147 browserSelect.appendChild(option); | 147 browserSelect.appendChild(option); |
| 148 } | 148 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 ImportDataOverlay.getInstance().updateSuccessState_(false); | 238 ImportDataOverlay.getInstance().updateSuccessState_(false); |
| 239 | 239 |
| 240 OptionsPage.navigateToPage('importData'); | 240 OptionsPage.navigateToPage('importData'); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 // Export | 243 // Export |
| 244 return { | 244 return { |
| 245 ImportDataOverlay: ImportDataOverlay | 245 ImportDataOverlay: ImportDataOverlay |
| 246 }; | 246 }; |
| 247 }); | 247 }); |
| OLD | NEW |