| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.NoThrottlingConditions); | 491 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.NoThrottlingConditions); |
| 492 return true; | 492 return true; |
| 493 } | 493 } |
| 494 if (actionId === "components.network-offline") { | 494 if (actionId === "components.network-offline") { |
| 495 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.OfflineConditions); | 495 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe
ctor.NetworkManager.OfflineConditions); |
| 496 return true; | 496 return true; |
| 497 } | 497 } |
| 498 return false; | 498 return false; |
| 499 } | 499 } |
| 500 }; | 500 }; |
| 501 |
| 502 /** |
| 503 * @param {?NetworkAgent.ResourcePriority} priority |
| 504 * @return {string} |
| 505 */ |
| 506 WebInspector.uiLabelForPriority = function(priority) |
| 507 { |
| 508 var labelMap = WebInspector.uiLabelForPriority._priorityToUILabel; |
| 509 if (!labelMap) { |
| 510 labelMap = new Map([ |
| 511 [NetworkAgent.ResourcePriority.VeryLow, WebInspector.UIString("Lowes
t")], |
| 512 [NetworkAgent.ResourcePriority.Low, WebInspector.UIString("Low")], |
| 513 [NetworkAgent.ResourcePriority.Medium, WebInspector.UIString("Medium
")], |
| 514 [NetworkAgent.ResourcePriority.High, WebInspector.UIString("High")], |
| 515 [NetworkAgent.ResourcePriority.VeryHigh, WebInspector.UIString("High
est")] |
| 516 ]); |
| 517 WebInspector.uiLabelForPriority._priorityToUILabel = labelMap; |
| 518 } |
| 519 return labelMap.get(priority) || WebInspector.UIString("Unknown"); |
| 520 }; |
| OLD | NEW |