Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 "Vary": WebInspector.UIString("Vary") | 177 "Vary": WebInspector.UIString("Vary") |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 WebInspector.NetworkLogView.prototype = { | 180 WebInspector.NetworkLogView.prototype = { |
| 181 /** | 181 /** |
| 182 * @param {boolean} recording | 182 * @param {boolean} recording |
| 183 */ | 183 */ |
| 184 setRecording: function(recording) | 184 setRecording: function(recording) |
| 185 { | 185 { |
| 186 this._recording = recording; | 186 this._recording = recording; |
| 187 this._updateSummaryBar(); | |
| 187 }, | 188 }, |
| 188 | 189 |
| 189 /** | 190 /** |
| 190 * @param {boolean} preserveLog | 191 * @param {boolean} preserveLog |
| 191 */ | 192 */ |
| 192 setPreserveLog: function(preserveLog) | 193 setPreserveLog: function(preserveLog) |
| 193 { | 194 { |
| 194 this._preserveLog = preserveLog; | 195 this._preserveLog = preserveLog; |
| 195 }, | 196 }, |
| 196 | 197 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 this._createTable(); | 285 this._createTable(); |
| 285 this._createTimelineGrid(); | 286 this._createTimelineGrid(); |
| 286 this._summaryBarElement = this.element.createChild("div", "network-summa ry-bar"); | 287 this._summaryBarElement = this.element.createChild("div", "network-summa ry-bar"); |
| 287 | 288 |
| 288 this._updateRowsSize(); | 289 this._updateRowsSize(); |
| 289 | 290 |
| 290 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this. _getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover. bind(this)); | 291 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this. _getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover. bind(this)); |
| 291 this.switchViewMode(true); | 292 this.switchViewMode(true); |
| 292 }, | 293 }, |
| 293 | 294 |
| 295 _showRecordingHint: function() | |
| 296 { | |
| 297 this._hideRecordingHint(); | |
| 298 this._recordingHint = this.element.createChild("div", "network-status-pa ne fill"); | |
| 299 var hintText = this._recordingHint.createChild("div", "recording-hint"); | |
| 300 var reloadShortcutNode = this._recordingHint.createChild("b"); | |
| 301 reloadShortcutNode.textContent = WebInspector.ShortcutsScreen.TimelinePa nelShortcuts.RecordPageReload[0].name; | |
| 302 | |
| 303 if (this._recording) { | |
| 304 var recordingText = hintText.createChild("span"); | |
| 305 recordingText.textContent = WebInspector.UIString("Recording network activity..."); | |
|
paulirish
2015/09/01 17:01:34
"Recording network activity\u2026"
| |
| 306 hintText.createChild("br"); | |
| 307 hintText.appendChild(WebInspector.formatLocalized(WebInspector.UIStr ing("Perform a request or hit %s to record the reload."), [reloadShortcutNode], null)); | |
| 308 } else { | |
| 309 var recordNode = hintText.createChild("b"); | |
| 310 recordNode.textContent = WebInspector.shortcutRegistry.shortcutTitle ForAction("network.toggle-recording"); | |
| 311 hintText.appendChild(WebInspector.formatLocalized(WebInspector.UIStr ing("Record (%s) or reload (%s) to display network activity."), [recordNode, rel oadShortcutNode], null)); | |
| 312 } | |
| 313 }, | |
| 314 | |
| 315 _hideRecordingHint: function() | |
| 316 { | |
| 317 if (this._recordingHint) | |
| 318 this._recordingHint.remove(); | |
| 319 delete this._recordingHint; | |
| 320 }, | |
| 321 | |
| 294 /** | 322 /** |
| 295 * @override | 323 * @override |
| 296 * @return {!Array.<!Element>} | 324 * @return {!Array.<!Element>} |
| 297 */ | 325 */ |
| 298 elementsToRestoreScrollPositionsFor: function() | 326 elementsToRestoreScrollPositionsFor: function() |
| 299 { | 327 { |
| 300 if (!this._dataGrid) // Not initialized yet. | 328 if (!this._dataGrid) // Not initialized yet. |
| 301 return []; | 329 return []; |
| 302 return [this._dataGrid.scrollContainer]; | 330 return [this._dataGrid.scrollContainer]; |
| 303 }, | 331 }, |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 this._dataGrid.sortNodes(sortingFunction); | 672 this._dataGrid.sortNodes(sortingFunction); |
| 645 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); | 673 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); |
| 646 this._dataGrid.markColumnAsSortedBy("timeline", selectedOption.sortOrder ); | 674 this._dataGrid.markColumnAsSortedBy("timeline", selectedOption.sortOrder ); |
| 647 }, | 675 }, |
| 648 | 676 |
| 649 _updateSummaryBar: function() | 677 _updateSummaryBar: function() |
| 650 { | 678 { |
| 651 var requestsNumber = this._nodesByRequestId.size; | 679 var requestsNumber = this._nodesByRequestId.size; |
| 652 | 680 |
| 653 if (!requestsNumber) { | 681 if (!requestsNumber) { |
| 682 this._showRecordingHint(); | |
| 654 if (this._summaryBarElement._isDisplayingWarning) | 683 if (this._summaryBarElement._isDisplayingWarning) |
| 655 return; | 684 return; |
| 656 this._summaryBarElement._isDisplayingWarning = true; | 685 this._summaryBarElement._isDisplayingWarning = true; |
| 657 this._summaryBarElement.removeChildren(); | 686 this._summaryBarElement.removeChildren(); |
| 658 this._summaryBarElement.createChild("label", "", "dt-icon-label").ty pe = "warning-icon"; | 687 this._summaryBarElement.createChild("label", "", "dt-icon-label").ty pe = "warning-icon"; |
| 659 var text = WebInspector.UIString("No requests captured. Reload the p age to see detailed information on the network activity."); | 688 var text = WebInspector.UIString("No requests captured. Reload the p age to see detailed information on the network activity."); |
| 660 this._summaryBarElement.createTextChild(text); | 689 this._summaryBarElement.createTextChild(text); |
| 661 this._summaryBarElement.title = text; | 690 this._summaryBarElement.title = text; |
| 662 return; | 691 return; |
| 663 } | 692 } |
| 693 this._hideRecordingHint(); | |
| 664 delete this._summaryBarElement._isDisplayingWarning; | 694 delete this._summaryBarElement._isDisplayingWarning; |
| 665 | 695 |
| 666 var transferSize = 0; | 696 var transferSize = 0; |
| 667 var selectedRequestsNumber = 0; | 697 var selectedRequestsNumber = 0; |
| 668 var selectedTransferSize = 0; | 698 var selectedTransferSize = 0; |
| 669 var baseTime = -1; | 699 var baseTime = -1; |
| 670 var maxTime = -1; | 700 var maxTime = -1; |
| 671 var nodes = this._nodesByRequestId.valuesArray(); | 701 var nodes = this._nodesByRequestId.valuesArray(); |
| 672 for (var i = 0; i < nodes.length; ++i) { | 702 for (var i = 0; i < nodes.length; ++i) { |
| 673 var request = nodes[i].request(); | 703 var request = nodes[i].request(); |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2067 return false; | 2097 return false; |
| 2068 return true; | 2098 return true; |
| 2069 } | 2099 } |
| 2070 | 2100 |
| 2071 WebInspector.NetworkLogView.EventTypes = { | 2101 WebInspector.NetworkLogView.EventTypes = { |
| 2072 RequestSelected: "RequestSelected", | 2102 RequestSelected: "RequestSelected", |
| 2073 SearchCountUpdated: "SearchCountUpdated", | 2103 SearchCountUpdated: "SearchCountUpdated", |
| 2074 SearchIndexUpdated: "SearchIndexUpdated", | 2104 SearchIndexUpdated: "SearchIndexUpdated", |
| 2075 UpdateRequest: "UpdateRequest" | 2105 UpdateRequest: "UpdateRequest" |
| 2076 }; | 2106 }; |
| OLD | NEW |