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 {!HTMLSelectElement} selectElement | 7 * @param {!HTMLSelectElement} selectElement |
8 */ | 8 */ |
9 WebInspector.NetworkConditionsSelector = function(selectElement) | 9 WebInspector.NetworkConditionsSelector = function(selectElement) |
10 { | 10 { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 * @param {!WebInspector.NetworkConditionsProfile} conditions | 202 * @param {!WebInspector.NetworkConditionsProfile} conditions |
203 * @param {boolean} custom | 203 * @param {boolean} custom |
204 * @return {!Element} | 204 * @return {!Element} |
205 */ | 205 */ |
206 _createConditionsListItem: function(conditions, custom) | 206 _createConditionsListItem: function(conditions, custom) |
207 { | 207 { |
208 var item = createElementWithClass("div", "conditions-list-item"); | 208 var item = createElementWithClass("div", "conditions-list-item"); |
209 var title = item.createChild("div", "conditions-list-text conditions-lis
t-title"); | 209 var title = item.createChild("div", "conditions-list-text conditions-lis
t-title"); |
210 var titleText = title.createChild("div", "conditions-list-title-text"); | 210 var titleText = title.createChild("div", "conditions-list-title-text"); |
211 titleText.textContent = conditions.title; | 211 titleText.textContent = conditions.title; |
212 WebInspector.Tooltip.install(titleText, conditions.title); | 212 titleText.title = conditions.title; |
213 item.createChild("div", "conditions-list-separator"); | 213 item.createChild("div", "conditions-list-separator"); |
214 item.createChild("div", "conditions-list-text").textContent = WebInspect
or.NetworkConditionsSelector.throughputText(conditions.value); | 214 item.createChild("div", "conditions-list-text").textContent = WebInspect
or.NetworkConditionsSelector.throughputText(conditions.value); |
215 item.createChild("div", "conditions-list-separator"); | 215 item.createChild("div", "conditions-list-separator"); |
216 item.createChild("div", "conditions-list-text").textContent = WebInspect
or.UIString("%dms", conditions.value.latency); | 216 item.createChild("div", "conditions-list-text").textContent = WebInspect
or.UIString("%dms", conditions.value.latency); |
217 | 217 |
218 if (custom) { | 218 if (custom) { |
219 var editButton = title.createChild("div", "conditions-list-edit"); | 219 var editButton = title.createChild("div", "conditions-list-edit"); |
220 editButton.title = WebInspector.UIString("Edit"); | 220 editButton.title = WebInspector.UIString("Edit"); |
221 editButton.addEventListener("click", onEditClicked.bind(this), false
); | 221 editButton.addEventListener("click", onEditClicked.bind(this), false
); |
222 | 222 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (this._editConditionsListItem) | 399 if (this._editConditionsListItem) |
400 this._editConditionsListItem.classList.remove("hidden"); | 400 this._editConditionsListItem.classList.remove("hidden"); |
401 if (this._editConditionsElement.parentElement) | 401 if (this._editConditionsElement.parentElement) |
402 this._conditionsList.removeChild(this._editConditionsElement); | 402 this._conditionsList.removeChild(this._editConditionsElement); |
403 this._addCustomButton.disabled = false; | 403 this._addCustomButton.disabled = false; |
404 this._addCustomButton.focus(); | 404 this._addCustomButton.focus(); |
405 }, | 405 }, |
406 | 406 |
407 __proto__: WebInspector.VBox.prototype | 407 __proto__: WebInspector.VBox.prototype |
408 } | 408 } |
OLD | NEW |