Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: Source/devtools/front_end/network/NetworkLogView.js

Issue 753103002: DevTools: NetworkPanel: add hide columns button. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: UI uodate Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 * @param {!WebInspector.Setting} coulmnsVisibilitySetting 37 * @param {!WebInspector.Setting} coulmnsVisibilitySetting
38 */ 38 */
39 WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting) 39 WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting)
40 { 40 {
41 WebInspector.VBox.call(this); 41 WebInspector.VBox.call(this);
42 this.registerRequiredCSS("network/networkLogView.css"); 42 this.registerRequiredCSS("network/networkLogView.css");
43 this.registerRequiredCSS("ui/filter.css"); 43 this.registerRequiredCSS("ui/filter.css");
44 44
45 this._filterBar = filterBar; 45 this._filterBar = filterBar;
46 this._coulmnsVisibilitySetting = coulmnsVisibilitySetting; 46 this._coulmnsVisibilitySetting = coulmnsVisibilitySetting;
47 this._hideColumnsSetting = WebInspector.settings.createSetting("networkLogHi deColumns", false);
47 /** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */ 48 /** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */
48 this._nodesByRequestId = new Map(); 49 this._nodesByRequestId = new Map();
49 /** @type {!Object.<string, boolean>} */ 50 /** @type {!Object.<string, boolean>} */
50 this._staleRequestIds = {}; 51 this._staleRequestIds = {};
51 /** @type {number} */ 52 /** @type {number} */
52 this._mainRequestLoadTime = -1; 53 this._mainRequestLoadTime = -1;
53 /** @type {number} */ 54 /** @type {number} */
54 this._mainRequestDOMContentLoadedTime = -1; 55 this._mainRequestDOMContentLoadedTime = -1;
55 this._matchedRequestCount = 0; 56 this._matchedRequestCount = 0;
56 this._highlightedSubstringChanges = []; 57 this._highlightedSubstringChanges = [];
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 /** 234 /**
234 * @return {!Array.<!WebInspector.StatusBarItem>} 235 * @return {!Array.<!WebInspector.StatusBarItem>}
235 */ 236 */
236 statusBarItems: function() 237 statusBarItems: function()
237 { 238 {
238 return [ 239 return [
239 this._recordButton, 240 this._recordButton,
240 this._clearButton, 241 this._clearButton,
241 this._filterBar.filterButton(), 242 this._filterBar.filterButton(),
242 this._largerRequestsButton, 243 this._largerRequestsButton,
244 this._hideColumnsButton,
243 this._preserveLogCheckbox, 245 this._preserveLogCheckbox,
244 this._disableCacheCheckbox, 246 this._disableCacheCheckbox,
245 new WebInspector.StatusBarItem(this._progressBarContainer) ]; 247 new WebInspector.StatusBarItem(this._progressBarContainer) ];
246 }, 248 },
247 249
248 /** 250 /**
249 * @return {boolean} 251 * @return {boolean}
250 */ 252 */
251 usesLargeRows: function() 253 usesLargeRows: function()
252 { 254 {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 timelineSorting.appendChild(option); 463 timelineSorting.appendChild(option);
462 464
463 var header = this._dataGrid.headerTableHeader("timeline"); 465 var header = this._dataGrid.headerTableHeader("timeline");
464 header.replaceChild(timelineSorting, header.firstChild); 466 header.replaceChild(timelineSorting, header.firstChild);
465 467
466 timelineSorting.addEventListener("click", function(event) { event.consum e() }, false); 468 timelineSorting.addEventListener("click", function(event) { event.consum e() }, false);
467 timelineSorting.addEventListener("change", this._sortByTimeline.bind(thi s), false); 469 timelineSorting.addEventListener("change", this._sortByTimeline.bind(thi s), false);
468 this._timelineSortSelector = timelineSorting; 470 this._timelineSortSelector = timelineSorting;
469 }, 471 },
470 472
473 /**
474 * @param {!WebInspector.Event} event
475 */
476 _clickHideColumnsButton: function(event)
477 {
478 this._toggleHideColumnsButton(!this._hideColumnsSetting.get());
479 },
480
481 /**
482 * @param {boolean} toggled
483 */
484 _toggleHideColumnsButton: function(toggled)
485 {
486 this._hideColumnsSetting.set(toggled);
487 this._hideColumnsButton.title = toggled ? WebInspector.UIString("Show co lumns.") : WebInspector.UIString("Hide columns.");
488 this._hideColumnsButton.setToggled(toggled);
489 this._updateColumns();
490 },
491
471 _createSortingFunctions: function() 492 _createSortingFunctions: function()
472 { 493 {
473 this._sortingFunctions = {}; 494 this._sortingFunctions = {};
474 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator; 495 this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameCompa rator;
475 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false); 496 this._sortingFunctions.method = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "method", false);
476 this._sortingFunctions.status = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "statusCode", false); 497 this._sortingFunctions.status = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "statusCode", false);
477 this._sortingFunctions.scheme = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "scheme", false); 498 this._sortingFunctions.scheme = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "scheme", false);
478 this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "domain", false); 499 this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.Request PropertyComparator.bind(null, "domain", false);
479 this._sortingFunctions.remoteAddress = WebInspector.NetworkDataGridNode. RemoteAddressComparator; 500 this._sortingFunctions.remoteAddress = WebInspector.NetworkDataGridNode. RemoteAddressComparator;
480 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "mimeType", false); 501 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPr opertyComparator.bind(null, "mimeType", false);
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 this._recordButton = new WebInspector.StatusBarButton("", "record-status -bar-item"); 728 this._recordButton = new WebInspector.StatusBarButton("", "record-status -bar-item");
708 this._recordButton.addEventListener("click", this._onRecordButtonClicked , this); 729 this._recordButton.addEventListener("click", this._onRecordButtonClicked , this);
709 730
710 this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIStri ng("Clear"), "clear-status-bar-item"); 731 this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIStri ng("Clear"), "clear-status-bar-item");
711 this._clearButton.addEventListener("click", this._reset, this); 732 this._clearButton.addEventListener("click", this._reset, this);
712 733
713 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect or.UIString("Use small resource rows."), "large-list-status-bar-item"); 734 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect or.UIString("Use small resource rows."), "large-list-status-bar-item");
714 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar geRows.get()); 735 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar geRows.get());
715 this._largerRequestsButton.addEventListener("click", this._toggleLargerR equests, this); 736 this._largerRequestsButton.addEventListener("click", this._toggleLargerR equests, this);
716 737
738 this._hideColumnsButton = new WebInspector.StatusBarButton("", "waterfal l-status-bar-item");
739 this._toggleHideColumnsButton(this._hideColumnsSetting.get());
740 this._hideColumnsButton.addEventListener("click", this._clickHideColumns Button, this);
741
717 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec tor.UIString("Preserve log")); 742 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec tor.UIString("Preserve log"));
718 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation."); 743 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation.");
719 744
720 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe ctor.UIString("Disable cache")); 745 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe ctor.UIString("Disable cache"));
721 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle ment, WebInspector.settings.cacheDisabled); 746 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle ment, WebInspector.settings.cacheDisabled);
722 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl e cache (while DevTools is open)."); 747 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl e cache (while DevTools is open).");
723 748
724 this._progressBarContainer = createElement("div"); 749 this._progressBarContainer = createElement("div");
725 }, 750 },
726 751
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 this._dataGrid.selectedNode.selected = false; 1009 this._dataGrid.selectedNode.selected = false;
985 } else { 1010 } else {
986 this._removeAllNodeHighlights(); 1011 this._removeAllNodeHighlights();
987 this._popoverHelper.hidePopover(); 1012 this._popoverHelper.hidePopover();
988 } 1013 }
989 1014
990 this.element.classList.toggle("brief-mode", !gridMode); 1015 this.element.classList.toggle("brief-mode", !gridMode);
991 this._updateColumns(); 1016 this._updateColumns();
992 }, 1017 },
993 1018
994 _toggleLargerRequests: function() 1019 /**
1020 * @param {!WebInspector.Event=} event
1021 */
1022 _toggleLargerRequests: function(event)
995 { 1023 {
996 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get()); 1024 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get());
997 this._updateRowsSize(); 1025 this._updateRowsSize();
998 }, 1026 },
999 1027
1000 /** 1028 /**
1001 * @return {number} 1029 * @return {number}
1002 */ 1030 */
1003 rowHeight: function() 1031 rowHeight: function()
1004 { 1032 {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 row.createChild("td"); 1127 row.createChild("td");
1100 appendStackTrace.call(this, callFrames); 1128 appendStackTrace.call(this, callFrames);
1101 asyncStackTrace = asyncStackTrace.asyncStackTrace; 1129 asyncStackTrace = asyncStackTrace.asyncStackTrace;
1102 } 1130 }
1103 1131
1104 return framesTable; 1132 return framesTable;
1105 }, 1133 },
1106 1134
1107 _updateColumns: function() 1135 _updateColumns: function()
1108 { 1136 {
1137 if (!this._dataGrid)
1138 return;
1109 var gridMode = this._gridMode; 1139 var gridMode = this._gridMode;
1110 var visibleColumns = {"name": true}; 1140 var visibleColumns = {"name": true};
1111 if (gridMode) { 1141 if (gridMode)
1112 visibleColumns["timeline"] = true; 1142 visibleColumns["timeline"] = true;
1143 if (gridMode && !this._hideColumnsSetting.get()) {
1113 var columnsVisibility = this._coulmnsVisibilitySetting.get(); 1144 var columnsVisibility = this._coulmnsVisibilitySetting.get();
1114 for (var columnIdentifier in columnsVisibility) 1145 for (var columnIdentifier in columnsVisibility)
1115 visibleColumns[columnIdentifier] = columnsVisibility[columnIdent ifier]; 1146 visibleColumns[columnIdentifier] = columnsVisibility[columnIdent ifier];
1116 } 1147 }
1117 1148
1118 this._dataGrid.setColumnsVisiblity(visibleColumns); 1149 this._dataGrid.setColumnsVisiblity(visibleColumns);
1119 }, 1150 },
1120 1151
1121 /** 1152 /**
1122 * @param {string} columnIdentifier 1153 * @param {string} columnIdentifier
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 return request.finished; 1910 return request.finished;
1880 } 1911 }
1881 1912
1882 WebInspector.NetworkLogView.EventTypes = { 1913 WebInspector.NetworkLogView.EventTypes = {
1883 ViewCleared: "ViewCleared", 1914 ViewCleared: "ViewCleared",
1884 RowSizeChanged: "RowSizeChanged", 1915 RowSizeChanged: "RowSizeChanged",
1885 RequestSelected: "RequestSelected", 1916 RequestSelected: "RequestSelected",
1886 SearchCountUpdated: "SearchCountUpdated", 1917 SearchCountUpdated: "SearchCountUpdated",
1887 SearchIndexUpdated: "SearchIndexUpdated" 1918 SearchIndexUpdated: "SearchIndexUpdated"
1888 }; 1919 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698