OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * ImportDataOverlay class |
| 7 * Encapsulated handling of the 'Import Data' overlay page. |
| 8 * @class |
| 9 */ |
| 10 function ImportDataOverlay() { |
| 11 OptionsPage.call(this, 'importDataOverlay', |
| 12 templateData.import_data_title, |
| 13 'importDataOverlay'); |
| 14 } |
| 15 |
| 16 cr.addSingletonGetter(ImportDataOverlay); |
| 17 |
| 18 ImportDataOverlay.prototype = { |
| 19 // Inherit ImportDataOverlay from OptionsPage. |
| 20 __proto__: OptionsPage.prototype, |
| 21 |
| 22 /** |
| 23 * Initialize the page. |
| 24 */ |
| 25 initializePage: function() { |
| 26 // Call base class implementation to starts preference initialization. |
| 27 OptionsPage.prototype.initializePage.call(this); |
| 28 |
| 29 $('import-data-cancel').onclick = function(e) { |
| 30 OptionsPage.clearOverlays(); |
| 31 } |
| 32 |
| 33 $('import-data-commit').onclick = function(e) { |
| 34 var paramList = new Array(); |
| 35 } |
| 36 }, |
| 37 |
| 38 /** |
| 39 * Clear the supported browsers popup |
| 40 * @private |
| 41 */ |
| 42 clearSupportedBrowsers_: function() { |
| 43 $('supported-browsers').textContent = ''; |
| 44 }, |
| 45 |
| 46 /** |
| 47 * Update the supported browsers popup with given entries. |
| 48 * @param {Array} list of supported browsers name. |
| 49 */ |
| 50 updateSupportedBrowsers_: function(browsers) { |
| 51 this.clearSupportedBrowsers_(); |
| 52 browserSelect = $('supported-browsers'); |
| 53 browserCount = browsers.length |
| 54 for (var i = 0; i < browserCount; i++) { |
| 55 var browser = browsers[i] |
| 56 var option = new Option(browser['name'], browser['index']); |
| 57 browserSelect.appendChild(option); |
| 58 } |
| 59 }, |
| 60 }; |
| 61 |
| 62 ImportDataOverlay.updateSupportedBrowsers = function(browsers) { |
| 63 ImportDataOverlay.getInstance().updateSupportedBrowsers_(browsers); |
| 64 } |
OLD | NEW |