| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 WebInspector.NetworkTimelineColumn = class extends WebInspector.VBox { | 7 WebInspector.NetworkTimelineColumn = class extends WebInspector.VBox { |
| 8 /** | 8 /** |
| 9 * @param {number} rowHeight | 9 * @param {number} rowHeight |
| 10 * @param {!WebInspector.NetworkTimeCalculator} calculator | 10 * @param {!WebInspector.NetworkTimeCalculator} calculator |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 var range = WebInspector.RequestTimingView.calculateRequestTimeRanges(this
._hoveredRequest, 0) | 91 var range = WebInspector.RequestTimingView.calculateRequestTimeRanges(this
._hoveredRequest, 0) |
| 92 .find(data => data.name === WebInspector.RequestTimeRangeNames.Total); | 92 .find(data => data.name === WebInspector.RequestTimeRangeNames.Total); |
| 93 var start = this._timeToPosition(range.start); | 93 var start = this._timeToPosition(range.start); |
| 94 var end = this._timeToPosition(range.end); | 94 var end = this._timeToPosition(range.end); |
| 95 } else { | 95 } else { |
| 96 var range = this._getSimplifiedBarRange(this._hoveredRequest, 0); | 96 var range = this._getSimplifiedBarRange(this._hoveredRequest, 0); |
| 97 var start = range.start; | 97 var start = range.start; |
| 98 var end = range.end; | 98 var end = range.end; |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (end - start < 50) { |
| 102 var halfWidth = (end - start) / 2; |
| 103 start = start + halfWidth - 25; |
| 104 end = end - halfWidth + 25; |
| 105 } |
| 106 |
| 101 if (event.clientX < this._canvasPosition.left + start || event.clientX > thi
s._canvasPosition.left + end) | 107 if (event.clientX < this._canvasPosition.left + start || event.clientX > thi
s._canvasPosition.left + end) |
| 102 return; | 108 return; |
| 103 | 109 |
| 104 var rowIndex = this._requestData.findIndex(request => this._hoveredRequest =
== request); | 110 var rowIndex = this._requestData.findIndex(request => this._hoveredRequest =
== request); |
| 105 var barHeight = this._getBarHeight(range.name); | 111 var barHeight = this._getBarHeight(range.name); |
| 106 var y = this._headerHeight + (this._rowHeight * rowIndex - this._scrollTop)
+ ((this._rowHeight - barHeight) / 2); | 112 var y = this._headerHeight + (this._rowHeight * rowIndex - this._scrollTop)
+ ((this._rowHeight - barHeight) / 2); |
| 107 | 113 |
| 108 if (event.clientY < this._canvasPosition.top + y || event.clientY > this._ca
nvasPosition.top + y + barHeight) | 114 if (event.clientY < this._canvasPosition.top + y || event.clientY > this._ca
nvasPosition.top + y + barHeight) |
| 109 return; | 115 return; |
| 110 | 116 |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 font: 'hsl(8, 100%, 80%)', | 620 font: 'hsl(8, 100%, 80%)', |
| 615 media: 'hsl(272, 64%, 80%)', | 621 media: 'hsl(272, 64%, 80%)', |
| 616 image: 'hsl(272, 64%, 80%)', | 622 image: 'hsl(272, 64%, 80%)', |
| 617 script: 'hsl(31, 100%, 80%)', | 623 script: 'hsl(31, 100%, 80%)', |
| 618 stylesheet: 'hsl(90, 50%, 80%)', | 624 stylesheet: 'hsl(90, 50%, 80%)', |
| 619 texttrack: 'hsl(8, 100%, 80%)', | 625 texttrack: 'hsl(8, 100%, 80%)', |
| 620 websocket: 'hsl(0, 0%, 95%)', | 626 websocket: 'hsl(0, 0%, 95%)', |
| 621 xhr: 'hsl(53, 100%, 80%)', | 627 xhr: 'hsl(53, 100%, 80%)', |
| 622 other: 'hsl(0, 0%, 95%)' | 628 other: 'hsl(0, 0%, 95%)' |
| 623 }; | 629 }; |
| OLD | NEW |