| 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 * @constructor | 6 * @constructor |
| 7 * @param {function(!Array<!WebInspector.NetworkConditionsGroup>):!Array<?WebIns
pector.NetworkManager.Conditions>} populateCallback | 7 * @param {function(!Array<!WebInspector.NetworkConditionsGroup>):!Array<?WebIns
pector.NetworkManager.Conditions>} populateCallback |
| 8 * @param {function(number)} selectCallback | 8 * @param {function(number)} selectCallback |
| 9 */ | 9 */ |
| 10 WebInspector.NetworkConditionsSelector = function(populateCallback, selectCallba
ck) | 10 WebInspector.NetworkConditionsSelector = function(populateCallback, selectCallba
ck) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 options = []; | 129 options = []; |
| 130 for (var i = 0; i < groups.length; ++i) { | 130 for (var i = 0; i < groups.length; ++i) { |
| 131 var group = groups[i]; | 131 var group = groups[i]; |
| 132 var groupElement = selectElement.createChild("optgroup"); | 132 var groupElement = selectElement.createChild("optgroup"); |
| 133 groupElement.label = group.title; | 133 groupElement.label = group.title; |
| 134 if (!i) { | 134 if (!i) { |
| 135 groupElement.appendChild(new Option(WebInspector.UIString("Add\u
2026"), WebInspector.UIString("Add\u2026"))); | 135 groupElement.appendChild(new Option(WebInspector.UIString("Add\u
2026"), WebInspector.UIString("Add\u2026"))); |
| 136 options.push(null); | 136 options.push(null); |
| 137 } | 137 } |
| 138 for (var conditions of group.items) { | 138 for (var conditions of group.items) { |
| 139 var title = WebInspector.NetworkConditionsSelector._conditionsTi
tle(conditions); | 139 var title = WebInspector.NetworkConditionsSelector._conditionsTi
tle(conditions, true); |
| 140 var option = new Option(title.text, title.text); | 140 var option = new Option(title.text, title.text); |
| 141 option.title = title.title; | 141 option.title = title.title; |
| 142 groupElement.appendChild(option); | 142 groupElement.appendChild(option); |
| 143 options.push(conditions); | 143 options.push(conditions); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 return options; | 146 return options; |
| 147 } | 147 } |
| 148 | 148 |
| 149 function optionSelected() | 149 function optionSelected() |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 */ | 420 */ |
| 421 function latencyValidator(item, index, input) | 421 function latencyValidator(item, index, input) |
| 422 { | 422 { |
| 423 var value = input.value.trim(); | 423 var value = input.value.trim(); |
| 424 return !value || (/^[\d]+$/.test(value) && value >= 0 && value <= 10
00000); | 424 return !value || (/^[\d]+$/.test(value) && value >= 0 && value <= 10
00000); |
| 425 } | 425 } |
| 426 }, | 426 }, |
| 427 | 427 |
| 428 __proto__: WebInspector.VBox.prototype | 428 __proto__: WebInspector.VBox.prototype |
| 429 } | 429 } |
| OLD | NEW |