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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 this.contentElement.appendChild(addButton); | 277 this.contentElement.appendChild(addButton); |
278 | 278 |
279 this._list = new WebInspector.ListWidget(this); | 279 this._list = new WebInspector.ListWidget(this); |
280 this._list.element.classList.add("conditions-list"); | 280 this._list.element.classList.add("conditions-list"); |
281 this._list.registerRequiredCSS("components/networkConditionsSettingsTab.css" ); | 281 this._list.registerRequiredCSS("components/networkConditionsSettingsTab.css" ); |
282 this._list.show(this.contentElement); | 282 this._list.show(this.contentElement); |
283 | 283 |
284 this._customSetting = WebInspector.moduleSetting("customNetworkConditions"); | 284 this._customSetting = WebInspector.moduleSetting("customNetworkConditions"); |
285 this._customSetting.addChangeListener(this._conditionsUpdated, this); | 285 this._customSetting.addChangeListener(this._conditionsUpdated, this); |
286 | 286 |
287 this.setDefaultFocusedElement(addButton); | 287 this.setDefaultFocusedElement(addButton); |
dgozman
2016/06/24 17:53:51
How does this call interact with new override?
luoe
2016/06/24 20:41:53
Good comment, I think this can be safely removed.
| |
288 this.contentElement.tabIndex = 0; | 288 this.contentElement.tabIndex = 0; |
289 } | 289 } |
290 | 290 |
291 WebInspector.NetworkConditionsSettingsTab.prototype = { | 291 WebInspector.NetworkConditionsSettingsTab.prototype = { |
292 /** | |
293 * @override | |
294 * @return {!Element} | |
295 */ | |
296 defaultFocusedElement: function() | |
297 { | |
298 return this.contentElement; | |
299 }, | |
300 | |
292 wasShown: function() | 301 wasShown: function() |
293 { | 302 { |
294 WebInspector.VBox.prototype.wasShown.call(this); | 303 WebInspector.VBox.prototype.wasShown.call(this); |
295 this._conditionsUpdated(); | 304 this._conditionsUpdated(); |
296 }, | 305 }, |
297 | 306 |
298 _conditionsUpdated: function() | 307 _conditionsUpdated: function() |
299 { | 308 { |
300 this._list.clear(); | 309 this._list.clear(); |
301 | 310 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe ctor.NetworkManager.NoThrottlingConditions); | 500 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe ctor.NetworkManager.NoThrottlingConditions); |
492 return true; | 501 return true; |
493 } | 502 } |
494 if (actionId === "components.network-offline") { | 503 if (actionId === "components.network-offline") { |
495 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe ctor.NetworkManager.OfflineConditions); | 504 WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspe ctor.NetworkManager.OfflineConditions); |
496 return true; | 505 return true; |
497 } | 506 } |
498 return false; | 507 return false; |
499 } | 508 } |
500 } | 509 } |
OLD | NEW |