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

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

Issue 422543002: DevTools: NetworkPanel: do not inject stylesheet. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 months 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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 /** 1744 /**
1745 * @constructor 1745 * @constructor
1746 * @implements {WebInspector.ContextMenu.Provider} 1746 * @implements {WebInspector.ContextMenu.Provider}
1747 * @implements {WebInspector.Searchable} 1747 * @implements {WebInspector.Searchable}
1748 * @extends {WebInspector.Panel} 1748 * @extends {WebInspector.Panel}
1749 */ 1749 */
1750 WebInspector.NetworkPanel = function() 1750 WebInspector.NetworkPanel = function()
1751 { 1751 {
1752 WebInspector.Panel.call(this, "network"); 1752 WebInspector.Panel.call(this, "network");
1753 this.registerRequiredCSS("networkPanel.css"); 1753 this.registerRequiredCSS("networkPanel.css");
1754 this._injectStyles();
1755 1754
1756 this._panelStatusBarElement = this.element.createChild("div", "panel-status- bar"); 1755 this._panelStatusBarElement = this.element.createChild("div", "panel-status- bar");
1757 this._filterBar = new WebInspector.FilterBar(); 1756 this._filterBar = new WebInspector.FilterBar();
1758 this._filtersContainer = this.element.createChild("div", "network-filters-he ader hidden"); 1757 this._filtersContainer = this.element.createChild("div", "network-filters-he ader hidden");
1759 this._filtersContainer.appendChild(this._filterBar.filtersElement()); 1758 this._filtersContainer.appendChild(this._filterBar.filtersElement());
1760 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle d, this._onFiltersToggled, this); 1759 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle d, this._onFiltersToggled, this);
1761 this._filterBar.setName("networkPanel"); 1760 this._filterBar.setName("networkPanel");
1762 1761
1763 this._searchableView = new WebInspector.SearchableView(this); 1762 this._searchableView = new WebInspector.SearchableView(this);
1764 this._searchableView.show(this.element); 1763 this._searchableView.show(this.element);
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 2057
2059 if (!(target instanceof WebInspector.NetworkRequest)) 2058 if (!(target instanceof WebInspector.NetworkRequest))
2060 return; 2059 return;
2061 var request = /** @type {!WebInspector.NetworkRequest} */ (target); 2060 var request = /** @type {!WebInspector.NetworkRequest} */ (target);
2062 if (this._networkItemView && this._networkItemView.isShowing() && this._ networkItemView.request() === request) 2061 if (this._networkItemView && this._networkItemView.isShowing() && this._ networkItemView.request() === request)
2063 return; 2062 return;
2064 2063
2065 appendRevealItem.call(this, request); 2064 appendRevealItem.call(this, request);
2066 }, 2065 },
2067 2066
2068 _injectStyles: function()
2069 {
2070 var style = document.createElement("style");
2071 var rules = [];
2072
2073 var columns = WebInspector.NetworkLogView._defaultColumnsVisibility;
2074
2075 var hideSelectors = [];
2076 var bgSelectors = [];
2077 for (var columnId in columns) {
2078 hideSelectors.push("#network-container .hide-" + columnId + "-column ." + columnId + "-column");
2079 bgSelectors.push(".network-log-grid.data-grid td." + columnId + "-co lumn");
2080 }
2081 rules.push(hideSelectors.join(", ") + "{border-left: 0 none transparent; }");
2082 rules.push(bgSelectors.join(", ") + "{background-color: rgba(0, 0, 0, 0. 07);}");
2083
2084 style.textContent = rules.join("\n");
2085 document.head.appendChild(style);
2086 },
2087
2088 __proto__: WebInspector.Panel.prototype 2067 __proto__: WebInspector.Panel.prototype
2089 } 2068 }
2090 2069
2091 /** 2070 /**
2092 * @constructor 2071 * @constructor
2093 * @implements {WebInspector.ContextMenu.Provider} 2072 * @implements {WebInspector.ContextMenu.Provider}
2094 */ 2073 */
2095 WebInspector.NetworkPanel.ContextMenuProvider = function() 2074 WebInspector.NetworkPanel.ContextMenuProvider = function()
2096 { 2075 {
2097 } 2076 }
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) 2997 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b)
3019 { 2998 {
3020 var aValue = a._request[propertyName]; 2999 var aValue = a._request[propertyName];
3021 var bValue = b._request[propertyName]; 3000 var bValue = b._request[propertyName];
3022 if (aValue > bValue) 3001 if (aValue > bValue)
3023 return revert ? -1 : 1; 3002 return revert ? -1 : 1;
3024 if (bValue > aValue) 3003 if (bValue > aValue)
3025 return revert ? 1 : -1; 3004 return revert ? 1 : -1;
3026 return a._request.indentityCompare(b._request); 3005 return a._request.indentityCompare(b._request);
3027 } 3006 }
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