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

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

Issue 720223002: DevTools: only allow status bar items in status bars. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 6 years, 1 month 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 this._matchedRequestCount = 0; 56 this._matchedRequestCount = 0;
57 this._highlightedSubstringChanges = []; 57 this._highlightedSubstringChanges = [];
58 58
59 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ 59 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */
60 this._filters = []; 60 this._filters = [];
61 61
62 this._currentMatchedRequestNode = null; 62 this._currentMatchedRequestNode = null;
63 this._currentMatchedRequestIndex = -1; 63 this._currentMatchedRequestIndex = -1;
64 64
65 this._createStatusbarButtons(); 65 this._createStatusbarButtons();
66 this._createStatusBarItems();
67 this._linkifier = new WebInspector.Linkifier(); 66 this._linkifier = new WebInspector.Linkifier();
68 67
69 this._allowPopover = true; 68 this._allowPopover = true;
70 69
71 /** @type {number} */ 70 /** @type {number} */
72 this._rowHeight = 0; 71 this._rowHeight = 0;
73 72
74 this._addFilters(); 73 this._addFilters();
75 this._resetSuggestionBuilder(); 74 this._resetSuggestionBuilder();
76 this._initializeView(); 75 this._initializeView();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 this._updateRowsSize(); 222 this._updateRowsSize();
224 223
225 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this. _getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover. bind(this)); 224 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this. _getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover. bind(this));
226 // Enable faster hint. 225 // Enable faster hint.
227 this._popoverHelper.setTimeout(250, 250); 226 this._popoverHelper.setTimeout(250, 250);
228 227
229 this.switchViewMode(true); 228 this.switchViewMode(true);
230 }, 229 },
231 230
232 /** 231 /**
233 * @return {!Array.<!Element>} 232 * @return {!Array.<!WebInspector.StatusBarItem>}
234 */ 233 */
235 statusBarItems: function() 234 statusBarItems: function()
236 { 235 {
237 return [ 236 return [
238 this._recordButton.element, 237 this._recordButton,
239 this._clearButton.element, 238 this._clearButton,
240 this._filterBar.filterButton().element, 239 this._filterBar.filterButton(),
241 this._largerRequestsButton.element, 240 this._largerRequestsButton,
242 this._preserveLogCheckbox.element, 241 this._preserveLogCheckbox,
243 this._disableCacheCheckbox.element, 242 this._disableCacheCheckbox,
244 this._progressBarContainer]; 243 new WebInspector.StatusBarItem(this._progressBarContainer) ];
245 }, 244 },
246 245
247 /** 246 /**
248 * @return {boolean} 247 * @return {boolean}
249 */ 248 */
250 usesLargeRows: function() 249 usesLargeRows: function()
251 { 250 {
252 return !!WebInspector.settings.resourcesLargeRows.get(); 251 return !!WebInspector.settings.resourcesLargeRows.get();
253 }, 252 },
254 253
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 var selectedOption = this._timelineSortSelector[selectedIndex]; 550 var selectedOption = this._timelineSortSelector[selectedIndex];
552 var value = selectedOption.value; 551 var value = selectedOption.value;
553 552
554 this._setCalculator(this._calculators[value]); 553 this._setCalculator(this._calculators[value]);
555 var sortingFunction = this._sortingFunctions[value]; 554 var sortingFunction = this._sortingFunctions[value];
556 this._dataGrid.sortNodes(sortingFunction); 555 this._dataGrid.sortNodes(sortingFunction);
557 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); 556 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false);
558 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or der.Ascending); 557 this._dataGrid.markColumnAsSortedBy("timeline", WebInspector.DataGrid.Or der.Ascending);
559 }, 558 },
560 559
561 _createStatusBarItems: function()
562 {
563 this._progressBarContainer = createElement("div");
564 this._progressBarContainer.className = "status-bar-item";
565 },
566
567 _updateSummaryBar: function() 560 _updateSummaryBar: function()
568 { 561 {
569 var requestsNumber = this._nodesByRequestId.size; 562 var requestsNumber = this._nodesByRequestId.size;
570 563
571 if (!requestsNumber) { 564 if (!requestsNumber) {
572 if (this._summaryBarElement._isDisplayingWarning) 565 if (this._summaryBarElement._isDisplayingWarning)
573 return; 566 return;
574 this._summaryBarElement._isDisplayingWarning = true; 567 this._summaryBarElement._isDisplayingWarning = true;
575 this._summaryBarElement.removeChildren(); 568 this._summaryBarElement.removeChildren();
576 this._summaryBarElement.createChild("div", "warning-icon-small"); 569 this._summaryBarElement.createChild("div", "warning-icon-small");
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it em"); 720 this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspect or.UIString("Use small resource rows."), "network-larger-resources-status-bar-it em");
728 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar geRows.get()); 721 this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLar geRows.get());
729 this._largerRequestsButton.addEventListener("click", this._toggleLargerR equests, this); 722 this._largerRequestsButton.addEventListener("click", this._toggleLargerR equests, this);
730 723
731 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec tor.UIString("Preserve log")); 724 this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspec tor.UIString("Preserve log"));
732 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation."); 725 this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation.");
733 726
734 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe ctor.UIString("Disable cache")); 727 this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspe ctor.UIString("Disable cache"));
735 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle ment, WebInspector.settings.cacheDisabled); 728 WebInspector.SettingsUI.bindCheckbox(this._disableCacheCheckbox.inputEle ment, WebInspector.settings.cacheDisabled);
736 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl e cache (while DevTools is open)."); 729 this._disableCacheCheckbox.element.title = WebInspector.UIString("Disabl e cache (while DevTools is open).");
730
731 this._progressBarContainer = createElement("div");
737 }, 732 },
738 733
739 /** 734 /**
740 * @param {!WebInspector.Event} event 735 * @param {!WebInspector.Event} event
741 */ 736 */
742 _loadEventFired: function(event) 737 _loadEventFired: function(event)
743 { 738 {
744 if (!this._recordButton.toggled()) 739 if (!this._recordButton.toggled())
745 return; 740 return;
746 741
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 * @constructor 1896 * @constructor
1902 * @implements {WebInspector.ContextMenu.Provider} 1897 * @implements {WebInspector.ContextMenu.Provider}
1903 * @implements {WebInspector.Searchable} 1898 * @implements {WebInspector.Searchable}
1904 * @extends {WebInspector.Panel} 1899 * @extends {WebInspector.Panel}
1905 */ 1900 */
1906 WebInspector.NetworkPanel = function() 1901 WebInspector.NetworkPanel = function()
1907 { 1902 {
1908 WebInspector.Panel.call(this, "network"); 1903 WebInspector.Panel.call(this, "network");
1909 this.registerRequiredCSS("network/networkPanel.css"); 1904 this.registerRequiredCSS("network/networkPanel.css");
1910 1905
1911 this._panelStatusBarElement = this.element.createChild("div", "panel-status- bar"); 1906 this._panelStatusBar = new WebInspector.StatusBar(this.element);
1912 this._filterBar = new WebInspector.FilterBar(); 1907 this._filterBar = new WebInspector.FilterBar();
1913 this._filtersContainer = this.element.createChild("div", "network-filters-he ader hidden"); 1908 this._filtersContainer = this.element.createChild("div", "network-filters-he ader hidden");
1914 this._filtersContainer.appendChild(this._filterBar.filtersElement()); 1909 this._filtersContainer.appendChild(this._filterBar.filtersElement());
1915 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle d, this._onFiltersToggled, this); 1910 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggle d, this._onFiltersToggled, this);
1916 this._filterBar.setName("networkPanel"); 1911 this._filterBar.setName("networkPanel");
1917 1912
1918 this._searchableView = new WebInspector.SearchableView(this); 1913 this._searchableView = new WebInspector.SearchableView(this);
1919 this._searchableView.show(this.element); 1914 this._searchableView.show(this.element);
1920 var contentsElement = this._searchableView.element; 1915 var contentsElement = this._searchableView.element;
1921 1916
(...skipping 26 matching lines...) Expand all
1948 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes .SearchCountUpdated, this._onSearchCountUpdated, this); 1943 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes .SearchCountUpdated, this._onSearchCountUpdated, this);
1949 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes .SearchIndexUpdated, this._onSearchIndexUpdated, this); 1944 this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes .SearchIndexUpdated, this._onSearchIndexUpdated, this);
1950 1945
1951 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c lose-button"); 1946 this._closeButtonElement = this._viewsContainerElement.createChild("div", "c lose-button");
1952 this._closeButtonElement.id = "network-close-button"; 1947 this._closeButtonElement.id = "network-close-button";
1953 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind (this), false); 1948 this._closeButtonElement.addEventListener("click", this._toggleGridMode.bind (this), false);
1954 this._viewsContainerElement.appendChild(this._closeButtonElement); 1949 this._viewsContainerElement.appendChild(this._closeButtonElement);
1955 1950
1956 var statusBarItems = this._networkLogView.statusBarItems(); 1951 var statusBarItems = this._networkLogView.statusBarItems();
1957 for (var i = 0; i < statusBarItems.length; ++i) 1952 for (var i = 0; i < statusBarItems.length; ++i)
1958 this._panelStatusBarElement.appendChild(statusBarItems[i]); 1953 this._panelStatusBar.appendStatusBarItem(statusBarItems[i]);
1959 1954
1960 /** 1955 /**
1961 * @this {WebInspector.NetworkPanel} 1956 * @this {WebInspector.NetworkPanel}
1962 * @return {?WebInspector.SourceFrame} 1957 * @return {?WebInspector.SourceFrame}
1963 */ 1958 */
1964 function sourceFrameGetter() 1959 function sourceFrameGetter()
1965 { 1960 {
1966 return this._networkItemView.currentSourceFrame(); 1961 return this._networkItemView.currentSourceFrame();
1967 } 1962 }
1968 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this)); 1963 WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this));
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 this._writeProgress.done(); 3297 this._writeProgress.done();
3303 return; 3298 return;
3304 } 3299 }
3305 const chunkSize = 100000; 3300 const chunkSize = 100000;
3306 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize); 3301 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize);
3307 this._bytesWritten += text.length; 3302 this._bytesWritten += text.length;
3308 stream.write(text, this._writeNextChunk.bind(this)); 3303 stream.write(text, this._writeNextChunk.bind(this));
3309 this._writeProgress.setWorked(this._bytesWritten); 3304 this._writeProgress.setWorked(this._bytesWritten);
3310 } 3305 }
3311 } 3306 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/inspectorStyle.css ('k') | Source/devtools/front_end/profiler/CPUProfileView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698