| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 var p = createElement('p'); | 51 var p = createElement('p'); |
| 52 p.appendChild(label); | 52 p.appendChild(label); |
| 53 return p; | 53 return p; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * @param {string} name | 57 * @param {string} name |
| 58 * @param {!Array<!Runtime.ExtensionDescriptor.Option>} options | 58 * @param {!Array<!Runtime.ExtensionDescriptor.Option>} options |
| 59 * @param {!Common.Setting} setting | 59 * @param {!Common.Setting} setting |
| 60 * @param {string=} subtitle |
| 60 * @return {!Element} | 61 * @return {!Element} |
| 61 */ | 62 */ |
| 62 UI.SettingsUI.createSettingSelect = function(name, options, setting) { | 63 UI.SettingsUI.createSettingSelect = function(name, options, setting, subtitle) { |
| 63 var p = createElement('p'); | 64 var p = createElement('p'); |
| 64 p.createChild('label').textContent = name; | 65 p.createChild('label').textContent = name; |
| 66 if (subtitle !== undefined) |
| 67 p.createChild('div', 'select-subtitle').textContent = subtitle; |
| 65 var select = p.createChild('select', 'chrome-select'); | 68 var select = p.createChild('select', 'chrome-select'); |
| 66 | 69 |
| 67 for (var i = 0; i < options.length; ++i) { | 70 for (var i = 0; i < options.length; ++i) { |
| 68 // The "raw" flag indicates text is non-i18n-izable. | 71 // The "raw" flag indicates text is non-i18n-izable. |
| 69 var option = /** @type {!Runtime.ExtensionDescriptor.Option} */ (options[i])
; | 72 var option = /** @type {!Runtime.ExtensionDescriptor.Option} */ (options[i])
; |
| 70 var optionText = /** @type {string} */ (option.text); | 73 var optionText = /** @type {string} */ (option.text); |
| 71 var optionName = option.raw ? optionText : Common.UIString(optionText); | 74 var optionName = option.raw ? optionText : Common.UIString(optionText); |
| 72 select.add(new Option(optionName, option.value)); | 75 select.add(new Option(optionName, option.value)); |
| 73 } | 76 } |
| 74 | 77 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 * @interface | 147 * @interface |
| 145 */ | 148 */ |
| 146 UI.SettingUI = function() {}; | 149 UI.SettingUI = function() {}; |
| 147 | 150 |
| 148 UI.SettingUI.prototype = { | 151 UI.SettingUI.prototype = { |
| 149 /** | 152 /** |
| 150 * @return {?Element} | 153 * @return {?Element} |
| 151 */ | 154 */ |
| 152 settingElement() {} | 155 settingElement() {} |
| 153 }; | 156 }; |
| OLD | NEW |