| 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 Network.NetworkLogViewColumns = class { | 7 Network.NetworkLogViewColumns = class { |
| 8 /** | 8 /** |
| 9 * @param {!Network.NetworkLogView} networkLogView | 9 * @param {!Network.NetworkLogView} networkLogView |
| 10 * @param {!Network.NetworkTransferTimeCalculator} timeCalculator | 10 * @param {!Network.NetworkTransferTimeCalculator} timeCalculator |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 Object.assign({}, defaultColumnConfig, currentConfigColumn)); | 95 Object.assign({}, defaultColumnConfig, currentConfigColumn)); |
| 96 columnConfig.id = columnConfig.id; | 96 columnConfig.id = columnConfig.id; |
| 97 if (columnConfig.subtitle) | 97 if (columnConfig.subtitle) |
| 98 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti
tle, columnConfig.subtitle); | 98 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti
tle, columnConfig.subtitle); |
| 99 this._columns.push(columnConfig); | 99 this._columns.push(columnConfig); |
| 100 } | 100 } |
| 101 this._loadCustomColumnsAndSettings(); | 101 this._loadCustomColumnsAndSettings(); |
| 102 | 102 |
| 103 this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element, thi
s._getPopoverRequest.bind(this)); | 103 this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element, thi
s._getPopoverRequest.bind(this)); |
| 104 this._popoverHelper.setHasPadding(true); | 104 this._popoverHelper.setHasPadding(true); |
| 105 this._popoverHelper.setTimeout(300, 300); |
| 105 | 106 |
| 106 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ | 107 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ |
| 107 this._dataGrid = | 108 this._dataGrid = |
| 108 new DataGrid.SortableDataGrid(this._columns.map(Network.NetworkLogViewCo
lumns._convertToDataGridDescriptor)); | 109 new DataGrid.SortableDataGrid(this._columns.map(Network.NetworkLogViewCo
lumns._convertToDataGridDescriptor)); |
| 109 this._dataGrid.element.addEventListener('mousedown', event => { | 110 this._dataGrid.element.addEventListener('mousedown', event => { |
| 110 if (!this._dataGrid.selectedNode && event.button) | 111 if (!this._dataGrid.selectedNode && event.button) |
| 111 event.consume(); | 112 event.consume(); |
| 112 }, true); | 113 }, true); |
| 113 | 114 |
| 114 this._dataGridScroller = this._dataGrid.scrollContainer; | 115 this._dataGridScroller = this._dataGrid.scrollContainer; |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 return true; | 543 return true; |
| 543 } | 544 } |
| 544 | 545 |
| 545 /** | 546 /** |
| 546 * @param {!Event} event | 547 * @param {!Event} event |
| 547 * @return {?UI.PopoverRequest} | 548 * @return {?UI.PopoverRequest} |
| 548 */ | 549 */ |
| 549 _getPopoverRequest(event) { | 550 _getPopoverRequest(event) { |
| 550 if (!this._gridMode) | 551 if (!this._gridMode) |
| 551 return null; | 552 return null; |
| 553 var hoveredNode = this._networkLogView.hoveredNode(); |
| 554 if (!hoveredNode) |
| 555 return null; |
| 552 | 556 |
| 553 var anchor = event.target.enclosingNodeOrSelfWithClass('network-script-initi
ated'); | 557 var anchor = event.target.enclosingNodeOrSelfWithClass('product-column'); |
| 554 var request = /** @type {?SDK.NetworkRequest} */ (anchor ? anchor.request :
null); | 558 if (anchor) { |
| 559 return { |
| 560 box: anchor.boxInWindow(), |
| 561 show: hoveredNode.handleProductPopover.bind(hoveredNode), |
| 562 hide: this._popupLinkifier.reset.bind(this._popupLinkifier) |
| 563 }; |
| 564 } |
| 565 |
| 566 anchor = event.target.enclosingNodeOrSelfWithClass('network-script-initiated
'); |
| 567 if (!anchor) |
| 568 return null; |
| 569 var request = hoveredNode.request(); |
| 555 var initiator = request ? request.initiator() : null; | 570 var initiator = request ? request.initiator() : null; |
| 556 if (!initiator || !initiator.stack) | 571 if (!initiator || !initiator.stack) |
| 557 return null; | 572 return null; |
| 558 | |
| 559 return { | 573 return { |
| 560 box: anchor.boxInWindow(), | 574 box: anchor.boxInWindow(), |
| 561 show: popover => { | 575 show: popover => { |
| 562 var content = Components.DOMPresentationUtils.buildStackTracePreviewCont
ents( | 576 var content = Components.DOMPresentationUtils.buildStackTracePreviewCont
ents( |
| 563 anchor.request.networkManager().target(), this._popupLinkifier, init
iator.stack); | 577 anchor.request.networkManager().target(), this._popupLinkifier, init
iator.stack); |
| 564 popover.contentElement.appendChild(content); | 578 popover.contentElement.appendChild(content); |
| 565 return Promise.resolve(true); | 579 return Promise.resolve(true); |
| 566 }, | 580 }, |
| 567 hide: () => { | 581 hide: this._popupLinkifier.reset.bind(this._popupLinkifier) |
| 568 this._popupLinkifier.reset(); | |
| 569 } | |
| 570 }; | 582 }; |
| 571 } | 583 } |
| 572 | 584 |
| 573 /** | 585 /** |
| 574 * @param {!Array<number>} times | 586 * @param {!Array<number>} times |
| 575 * @param {string} className | 587 * @param {string} className |
| 576 */ | 588 */ |
| 577 addEventDividers(times, className) { | 589 addEventDividers(times, className) { |
| 578 // TODO(allada) Remove this and pass in the color. | 590 // TODO(allada) Remove this and pass in the color. |
| 579 var color = 'transparent'; | 591 var color = 'transparent'; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 /** | 836 /** |
| 825 * @enum {string} | 837 * @enum {string} |
| 826 */ | 838 */ |
| 827 Network.NetworkLogViewColumns.WaterfallSortIds = { | 839 Network.NetworkLogViewColumns.WaterfallSortIds = { |
| 828 StartTime: 'startTime', | 840 StartTime: 'startTime', |
| 829 ResponseTime: 'responseReceivedTime', | 841 ResponseTime: 'responseReceivedTime', |
| 830 EndTime: 'endTime', | 842 EndTime: 'endTime', |
| 831 Duration: 'duration', | 843 Duration: 'duration', |
| 832 Latency: 'latency' | 844 Latency: 'latency' |
| 833 }; | 845 }; |
| OLD | NEW |