Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSettingsTab.js

Issue 2876683002: DevTools: simplify network throttling presets (Closed)
Patch Set: update browser test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 * @implements {UI.ListWidget.Delegate} 6 * @implements {UI.ListWidget.Delegate}
7 * @unrestricted 7 * @unrestricted
8 */ 8 */
9 NetworkConditions.NetworkConditionsSettingsTab = class extends UI.VBox { 9 NetworkConditions.NetworkConditionsSettingsTab = class extends UI.VBox {
10 constructor() { 10 constructor() {
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 _conditionsUpdated() { 40 _conditionsUpdated() {
41 this._list.clear(); 41 this._list.clear();
42 42
43 var conditions = this._customSetting.get(); 43 var conditions = this._customSetting.get();
44 for (var i = 0; i < conditions.length; ++i) 44 for (var i = 0; i < conditions.length; ++i)
45 this._list.appendItem(conditions[i], true); 45 this._list.appendItem(conditions[i], true);
46 46
47 this._list.appendSeparator(); 47 this._list.appendSeparator();
48
49 conditions = NetworkConditions.NetworkConditionsSelector.presets;
50 for (var i = 0; i < conditions.length; ++i)
51 this._list.appendItem(conditions[i], false);
52 } 48 }
53 49
54 _addButtonClicked() { 50 _addButtonClicked() {
55 this._list.addNewItem(this._customSetting.get().length, {title: '', download : -1, upload: -1, latency: 0}); 51 this._list.addNewItem(this._customSetting.get().length, {title: '', download : -1, upload: -1, latency: 0});
56 } 52 }
57 53
58 /** 54 /**
59 * @override 55 * @override
60 * @param {*} item 56 * @param {*} item
61 * @param {boolean} editable 57 * @param {boolean} editable
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 * @param {number} index 192 * @param {number} index
197 * @param {!HTMLInputElement|!HTMLSelectElement} input 193 * @param {!HTMLInputElement|!HTMLSelectElement} input
198 * @return {boolean} 194 * @return {boolean}
199 */ 195 */
200 function latencyValidator(item, index, input) { 196 function latencyValidator(item, index, input) {
201 var value = input.value.trim(); 197 var value = input.value.trim();
202 return !value || (/^[\d]+$/.test(value) && value >= 0 && value <= 1000000) ; 198 return !value || (/^[\d]+$/.test(value) && value >= 0 && value <= 1000000) ;
203 } 199 }
204 } 200 }
205 }; 201 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network_conditions/NetworkConditionsSelector.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698