| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 options = []; | 140 options = []; |
| 141 for (var i = 0; i < groups.length; ++i) { | 141 for (var i = 0; i < groups.length; ++i) { |
| 142 var group = groups[i]; | 142 var group = groups[i]; |
| 143 var groupElement = selectElement.createChild("optgroup"); | 143 var groupElement = selectElement.createChild("optgroup"); |
| 144 groupElement.label = group.title; | 144 groupElement.label = group.title; |
| 145 if (!i) { | 145 if (!i) { |
| 146 groupElement.appendChild(new Option(WebInspector.UIString("Add\u
2026"), WebInspector.UIString("Add\u2026"))); | 146 groupElement.appendChild(new Option(WebInspector.UIString("Add\u
2026"), WebInspector.UIString("Add\u2026"))); |
| 147 options.push(null); | 147 options.push(null); |
| 148 } | 148 } |
| 149 for (var conditions of group.items) { | 149 for (var conditions of group.items) { |
| 150 var title = WebInspector.NetworkConditionsSelector._conditionsTi
tle(conditions); | 150 var title = WebInspector.NetworkConditionsSelector._conditionsTi
tle(conditions, true); |
| 151 var option = new Option(title.text, title.text); | 151 var option = new Option(title.text, title.text); |
| 152 option.title = title.title; | 152 option.title = title.title; |
| 153 groupElement.appendChild(option); | 153 groupElement.appendChild(option); |
| 154 options.push(conditions); | 154 options.push(conditions); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 return options; | 157 return options; |
| 158 } | 158 } |
| 159 | 159 |
| 160 function optionSelected() | 160 function optionSelected() |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.NoThrottlingConditions); | 460 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.NoThrottlingConditions); |
| 461 return true; | 461 return true; |
| 462 } | 462 } |
| 463 if (actionId === "components.network-offline") { | 463 if (actionId === "components.network-offline") { |
| 464 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.OfflineConditions); | 464 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.OfflineConditions); |
| 465 return true; | 465 return true; |
| 466 } | 466 } |
| 467 return false; | 467 return false; |
| 468 } | 468 } |
| 469 } | 469 } |
| OLD | NEW |