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

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

Issue 203603006: DevTools: Make GoToLineDialog work based on sourceFrame and remove (can)highlightPosition methods f… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 9 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 | Annotate | Revision Log
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 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c lose-button"); 1729 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c lose-button");
1730 this._closeButtonElement.id = "network-close-button"; 1730 this._closeButtonElement.id = "network-close-button";
1731 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind (this), false); 1731 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind (this), false);
1732 this._viewsContainerElement.appendChild(this._closeButtonElement); 1732 this._viewsContainerElement.appendChild(this._closeButtonElement);
1733 1733
1734 for (var i = 0; i < this._networkLogView.statusBarItems.length; ++i) 1734 for (var i = 0; i < this._networkLogView.statusBarItems.length; ++i)
1735 this._panelStatusBarElement.appendChild(this._networkLogView.statusBarIt ems[i]); 1735 this._panelStatusBarElement.appendChild(this._networkLogView.statusBarIt ems[i]);
1736 1736
1737 /** 1737 /**
1738 * @this {WebInspector.NetworkPanel} 1738 * @this {WebInspector.NetworkPanel}
1739 * @return {?WebInspector.SourceFrame}
1739 */ 1740 */
1740 function viewGetter() 1741 function sourceFrameGetter()
1741 { 1742 {
1742 return this.visibleView; 1743 return this._networkItemView.currentSourceFrame();
1743 } 1744 }
1744 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); 1745 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this));
1745 } 1746 }
1746 1747
1747 /** @enum {string} */ 1748 /** @enum {string} */
1748 WebInspector.NetworkPanel.FilterType = { 1749 WebInspector.NetworkPanel.FilterType = {
1749 Domain: "Domain", 1750 Domain: "Domain",
1750 HasResponseHeader: "HasResponseHeader", 1751 HasResponseHeader: "HasResponseHeader",
1751 MimeType: "MimeType", 1752 MimeType: "MimeType",
1752 SetCookieDomain: "SetCookieDomain", 1753 SetCookieDomain: "SetCookieDomain",
1753 SetCookieName: "SetCookieName", 1754 SetCookieName: "SetCookieName",
1754 SetCookieValue: "SetCookieValue" 1755 SetCookieValue: "SetCookieValue"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 _onSearchIndexUpdated: function(event) 1841 _onSearchIndexUpdated: function(event)
1841 { 1842 {
1842 this._searchableView.updateCurrentMatchIndex(event.data); 1843 this._searchableView.updateCurrentMatchIndex(event.data);
1843 }, 1844 },
1844 1845
1845 _onRequestSelected: function(event) 1846 _onRequestSelected: function(event)
1846 { 1847 {
1847 this._showRequest(event.data); 1848 this._showRequest(event.data);
1848 }, 1849 },
1849 1850
1851 /**
1852 * @param {?WebInspector.NetworkRequest} request
1853 */
1850 _showRequest: function(request) 1854 _showRequest: function(request)
1851 { 1855 {
1852 if (!request) 1856 if (!request)
1853 return; 1857 return;
1854 1858
1855 this._toggleViewingRequestMode(); 1859 this._toggleViewingRequestMode();
1856 1860
1857 if (this.visibleView) { 1861 if (this._networkItemView) {
1858 this.visibleView.detach(); 1862 this._networkItemView.detach();
1859 delete this.visibleView; 1863 delete this._networkItemView;
1860 } 1864 }
1861 1865
1862 var view = new WebInspector.NetworkItemView(request); 1866 var view = new WebInspector.NetworkItemView(request);
1863 view.show(this._viewsContainerElement); 1867 view.show(this._viewsContainerElement);
1864 this.visibleView = view; 1868 this._networkItemView = view;
1865 }, 1869 },
1866 1870
1867 _closeVisibleRequest: function() 1871 _closeVisibleRequest: function()
1868 { 1872 {
1869 this.element.classList.remove("viewing-resource"); 1873 this.element.classList.remove("viewing-resource");
1870 1874
1871 if (this.visibleView) { 1875 if (this._networkItemView) {
1872 this.visibleView.detach(); 1876 this._networkItemView.detach();
1873 delete this.visibleView; 1877 delete this._networkItemView;
1874 } 1878 }
1875 }, 1879 },
1876 1880
1877 _toggleGridMode: function() 1881 _toggleGridMode: function()
1878 { 1882 {
1879 if (this._viewingRequestMode) { 1883 if (this._viewingRequestMode) {
1880 this._viewingRequestMode = false; 1884 this._viewingRequestMode = false;
1881 this.element.classList.remove("viewing-resource"); 1885 this.element.classList.remove("viewing-resource");
1882 this._splitView.hideMain(); 1886 this._splitView.hideMain();
1883 } 1887 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target ); 1963 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target );
1960 var resource = WebInspector.resourceForURL(uiSourceCode.url); 1964 var resource = WebInspector.resourceForURL(uiSourceCode.url);
1961 if (resource && resource.request) 1965 if (resource && resource.request)
1962 appendRevealItem.call(this, resource.request); 1966 appendRevealItem.call(this, resource.request);
1963 return; 1967 return;
1964 } 1968 }
1965 1969
1966 if (!(target instanceof WebInspector.NetworkRequest)) 1970 if (!(target instanceof WebInspector.NetworkRequest))
1967 return; 1971 return;
1968 var request = /** @type {!WebInspector.NetworkRequest} */ (target); 1972 var request = /** @type {!WebInspector.NetworkRequest} */ (target);
1969 if (this.visibleView && this.visibleView.isShowing() && this.visibleView .request() === request) 1973 if (this._networkItemView && this._networkItemView.isShowing() && this._ networkItemView.request() === request)
1970 return; 1974 return;
1971 1975
1972 appendRevealItem.call(this, request); 1976 appendRevealItem.call(this, request);
1973 }, 1977 },
1974 1978
1975 _injectStyles: function() 1979 _injectStyles: function()
1976 { 1980 {
1977 var style = document.createElement("style"); 1981 var style = document.createElement("style");
1978 var rules = []; 1982 var rules = [];
1979 1983
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
2892 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) 2896 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b)
2893 { 2897 {
2894 var aValue = a._request[propertyName]; 2898 var aValue = a._request[propertyName];
2895 var bValue = b._request[propertyName]; 2899 var bValue = b._request[propertyName];
2896 if (aValue > bValue) 2900 if (aValue > bValue)
2897 return revert ? -1 : 1; 2901 return revert ? -1 : 1;
2898 if (bValue > aValue) 2902 if (bValue > aValue)
2899 return revert ? 1 : -1; 2903 return revert ? 1 : -1;
2900 return 0; 2904 return 0;
2901 } 2905 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/NetworkItemView.js ('k') | Source/devtools/front_end/ResourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698