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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 columnConfig.id = columnConfig.id; | 84 columnConfig.id = columnConfig.id; |
85 if (columnConfig.subtitle) | 85 if (columnConfig.subtitle) |
86 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti
tle, columnConfig.subtitle); | 86 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti
tle, columnConfig.subtitle); |
87 this._columns.push(columnConfig); | 87 this._columns.push(columnConfig); |
88 } | 88 } |
89 this._loadColumns(); | 89 this._loadColumns(); |
90 | 90 |
91 this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element); | 91 this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element); |
92 this._popoverHelper.initializeCallbacks( | 92 this._popoverHelper.initializeCallbacks( |
93 this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._o
nHidePopover.bind(this)); | 93 this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._o
nHidePopover.bind(this)); |
| 94 this._popoverHelper.setHasPadding(true); |
94 | 95 |
95 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ | 96 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ |
96 this._dataGrid = | 97 this._dataGrid = |
97 new DataGrid.SortableDataGrid(this._columns.map(Network.NetworkLogViewCo
lumns._convertToDataGridDescriptor)); | 98 new DataGrid.SortableDataGrid(this._columns.map(Network.NetworkLogViewCo
lumns._convertToDataGridDescriptor)); |
98 this._dataGrid.element.addEventListener('mousedown', event => { | 99 this._dataGrid.element.addEventListener('mousedown', event => { |
99 if (!this._dataGrid.selectedNode && event.button) | 100 if (!this._dataGrid.selectedNode && event.button) |
100 event.consume(); | 101 event.consume(); |
101 }, true); | 102 }, true); |
102 | 103 |
103 this._dataGridScroller = this._dataGrid.scrollContainer; | 104 this._dataGridScroller = this._dataGrid.scrollContainer; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 var anchor = element.enclosingNodeOrSelfWithClass('network-script-initiated'
); | 532 var anchor = element.enclosingNodeOrSelfWithClass('network-script-initiated'
); |
532 if (anchor && anchor.request) { | 533 if (anchor && anchor.request) { |
533 var initiator = /** @type {!SDK.NetworkRequest} */ (anchor.request).initia
tor(); | 534 var initiator = /** @type {!SDK.NetworkRequest} */ (anchor.request).initia
tor(); |
534 if (initiator && initiator.stack) | 535 if (initiator && initiator.stack) |
535 return anchor; | 536 return anchor; |
536 } | 537 } |
537 } | 538 } |
538 | 539 |
539 /** | 540 /** |
540 * @param {!Element} anchor | 541 * @param {!Element} anchor |
541 * @param {!UI.Popover} popover | 542 * @param {!UI.GlassPane} popover |
| 543 * @return {!Promise<boolean>} |
542 */ | 544 */ |
543 _showPopover(anchor, popover) { | 545 _showPopover(anchor, popover) { |
544 var request = /** @type {!SDK.NetworkRequest} */ (anchor.request); | 546 var request = /** @type {!SDK.NetworkRequest} */ (anchor.request); |
545 var initiator = /** @type {!Protocol.Network.Initiator} */ (request.initiato
r()); | 547 var initiator = /** @type {!Protocol.Network.Initiator} */ (request.initiato
r()); |
546 var content = Components.DOMPresentationUtils.buildStackTracePreviewContents
( | 548 var content = Components.DOMPresentationUtils.buildStackTracePreviewContents
( |
547 request.target(), this._popupLinkifier, initiator.stack); | 549 request.target(), this._popupLinkifier, initiator.stack); |
548 popover.showForAnchor(content, anchor); | 550 popover.contentElement.appendChild(content); |
| 551 return Promise.resolve(true); |
549 } | 552 } |
550 | 553 |
551 _onHidePopover() { | 554 _onHidePopover() { |
552 this._popupLinkifier.reset(); | 555 this._popupLinkifier.reset(); |
553 } | 556 } |
554 | 557 |
555 /** | 558 /** |
556 * @param {!Array<number>} times | 559 * @param {!Array<number>} times |
557 * @param {string} className | 560 * @param {string} className |
558 */ | 561 */ |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 /** | 807 /** |
805 * @enum {string} | 808 * @enum {string} |
806 */ | 809 */ |
807 Network.NetworkLogViewColumns.WaterfallSortIds = { | 810 Network.NetworkLogViewColumns.WaterfallSortIds = { |
808 StartTime: 'startTime', | 811 StartTime: 'startTime', |
809 ResponseTime: 'responseReceivedTime', | 812 ResponseTime: 'responseReceivedTime', |
810 EndTime: 'endTime', | 813 EndTime: 'endTime', |
811 Duration: 'duration', | 814 Duration: 'duration', |
812 Latency: 'latency' | 815 Latency: 'latency' |
813 }; | 816 }; |
OLD | NEW |