| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Components.NetworkConditionsSelector = class { | 7 Components.NetworkConditionsSelector = class { |
| 8 /** | 8 /** |
| 9 * @param {function(!Array<!Components.NetworkConditionsGroup>):!Array<?SDK.Ne
tworkManager.Conditions>} populateCallback | 9 * @param {function(!Array<!Components.NetworkConditionsGroup>):!Array<?SDK.Ne
tworkManager.Conditions>} populateCallback |
| 10 * @param {function(number)} selectCallback | 10 * @param {function(number)} selectCallback |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 * @implements {UI.ListWidget.Delegate} | 261 * @implements {UI.ListWidget.Delegate} |
| 262 * @unrestricted | 262 * @unrestricted |
| 263 */ | 263 */ |
| 264 Components.NetworkConditionsSettingsTab = class extends UI.VBox { | 264 Components.NetworkConditionsSettingsTab = class extends UI.VBox { |
| 265 constructor() { | 265 constructor() { |
| 266 super(true); | 266 super(true); |
| 267 this.registerRequiredCSS('components/networkConditionsSettingsTab.css'); | 267 this.registerRequiredCSS('components/networkConditionsSettingsTab.css'); |
| 268 | 268 |
| 269 this.contentElement.createChild('div', 'header').textContent = Common.UIStri
ng('Network Throttling Profiles'); | 269 this.contentElement.createChild('div', 'header').textContent = Common.UIStri
ng('Network Throttling Profiles'); |
| 270 | 270 |
| 271 var addButton = createTextButton( | 271 var addButton = UI.createTextButton( |
| 272 Common.UIString('Add custom profile...'), this._addButtonClicked.bind(th
is), 'add-conditions-button'); | 272 Common.UIString('Add custom profile...'), this._addButtonClicked.bind(th
is), 'add-conditions-button'); |
| 273 this.contentElement.appendChild(addButton); | 273 this.contentElement.appendChild(addButton); |
| 274 | 274 |
| 275 this._list = new UI.ListWidget(this); | 275 this._list = new UI.ListWidget(this); |
| 276 this._list.element.classList.add('conditions-list'); | 276 this._list.element.classList.add('conditions-list'); |
| 277 this._list.registerRequiredCSS('components/networkConditionsSettingsTab.css'
); | 277 this._list.registerRequiredCSS('components/networkConditionsSettingsTab.css'
); |
| 278 this._list.show(this.contentElement); | 278 this._list.show(this.contentElement); |
| 279 | 279 |
| 280 this._customSetting = Common.moduleSetting('customNetworkConditions'); | 280 this._customSetting = Common.moduleSetting('customNetworkConditions'); |
| 281 this._customSetting.addChangeListener(this._conditionsUpdated, this); | 281 this._customSetting.addChangeListener(this._conditionsUpdated, this); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 [Protocol.Network.ResourcePriority.VeryLow, Common.UIString('Lowest')], | 494 [Protocol.Network.ResourcePriority.VeryLow, Common.UIString('Lowest')], |
| 495 [Protocol.Network.ResourcePriority.Low, Common.UIString('Low')], | 495 [Protocol.Network.ResourcePriority.Low, Common.UIString('Low')], |
| 496 [Protocol.Network.ResourcePriority.Medium, Common.UIString('Medium')], | 496 [Protocol.Network.ResourcePriority.Medium, Common.UIString('Medium')], |
| 497 [Protocol.Network.ResourcePriority.High, Common.UIString('High')], | 497 [Protocol.Network.ResourcePriority.High, Common.UIString('High')], |
| 498 [Protocol.Network.ResourcePriority.VeryHigh, Common.UIString('Highest')] | 498 [Protocol.Network.ResourcePriority.VeryHigh, Common.UIString('Highest')] |
| 499 ]); | 499 ]); |
| 500 Components.uiLabelForPriority._priorityToUILabel = labelMap; | 500 Components.uiLabelForPriority._priorityToUILabel = labelMap; |
| 501 } | 501 } |
| 502 return labelMap.get(priority) || Common.UIString('Unknown'); | 502 return labelMap.get(priority) || Common.UIString('Unknown'); |
| 503 }; | 503 }; |
| OLD | NEW |