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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 this._createStatusBarItems(); | 76 this._createStatusBarItems(); |
| 77 this._linkifier = new WebInspector.Linkifier(); | 77 this._linkifier = new WebInspector.Linkifier(); |
| 78 | 78 |
| 79 this._allowPopover = true; | 79 this._allowPopover = true; |
| 80 | 80 |
| 81 this._addFilters(); | 81 this._addFilters(); |
| 82 this._resetSuggestionBuilder(); | 82 this._resetSuggestionBuilder(); |
| 83 this._initializeView(); | 83 this._initializeView(); |
| 84 this._recordButton.toggled = true; | 84 this._recordButton.toggled = true; |
| 85 | 85 |
| 86 this._rowHeight = 41; | |
|
lushnikov
2014/07/28 16:33:56
= 0
+ @type
+ call _setLargerRequests unconditiona
eustas
2014/07/29 07:00:29
Done.
| |
| 87 | |
| 86 WebInspector.targetManager.observeTargets(this); | 88 WebInspector.targetManager.observeTargets(this); |
| 87 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this ); | 89 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this ); |
| 88 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this ); | 90 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this ); |
| 89 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi s); | 91 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi s); |
| 90 | 92 |
| 91 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this); | 93 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this); |
| 92 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNav igated, this); | 94 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNav igated, this); |
| 93 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this); | 95 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this); |
| 94 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._domContentLoad edEventFired, this); | 96 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._domContentLoad edEventFired, this); |
| 95 } | 97 } |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 this._popoverHelper.hidePopover(); | 967 this._popoverHelper.hidePopover(); |
| 966 }, | 968 }, |
| 967 | 969 |
| 968 _toggleLargerRequests: function() | 970 _toggleLargerRequests: function() |
| 969 { | 971 { |
| 970 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get()); | 972 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get()); |
| 971 this._setLargerRequests(WebInspector.settings.resourcesLargeRows.get()); | 973 this._setLargerRequests(WebInspector.settings.resourcesLargeRows.get()); |
| 972 }, | 974 }, |
| 973 | 975 |
| 974 /** | 976 /** |
| 977 * @return {number} | |
| 978 */ | |
| 979 rowHeight: function() | |
| 980 { | |
| 981 return this._rowHeight; | |
| 982 }, | |
| 983 | |
| 984 /** | |
| 975 * @param {boolean} enabled | 985 * @param {boolean} enabled |
| 976 */ | 986 */ |
| 977 _setLargerRequests: function(enabled) | 987 _setLargerRequests: function(enabled) |
| 978 { | 988 { |
| 979 this._largerRequestsButton.toggled = enabled; | 989 this._largerRequestsButton.toggled = enabled; |
| 980 if (!enabled) { | 990 if (!enabled) { |
| 991 this._rowHeight = 41; | |
| 981 this._largerRequestsButton.title = WebInspector.UIString("Use large resource rows."); | 992 this._largerRequestsButton.title = WebInspector.UIString("Use large resource rows."); |
| 982 this._dataGrid.element.classList.add("small"); | 993 this._dataGrid.element.classList.add("small"); |
| 983 this._timelineGrid.element.classList.add("small"); | 994 this._timelineGrid.element.classList.add("small"); |
| 984 } else { | 995 } else { |
| 996 this._rowHeight = 21; | |
| 985 this._largerRequestsButton.title = WebInspector.UIString("Use small resource rows."); | 997 this._largerRequestsButton.title = WebInspector.UIString("Use small resource rows."); |
| 986 this._dataGrid.element.classList.remove("small"); | 998 this._dataGrid.element.classList.remove("small"); |
| 987 this._timelineGrid.element.classList.remove("small"); | 999 this._timelineGrid.element.classList.remove("small"); |
| 988 } | 1000 } |
| 989 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Row SizeChanged, { largeRows: enabled }); | 1001 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Row SizeChanged, { largeRows: enabled }); |
| 990 }, | 1002 }, |
| 991 | 1003 |
| 992 /** | 1004 /** |
| 993 * @param {!Element} element | 1005 * @param {!Element} element |
| 994 * @param {!Event} event | 1006 * @param {!Event} event |
| (...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2506 { | 2518 { |
| 2507 WebInspector.SortableDataGridNode.call(this, {}); | 2519 WebInspector.SortableDataGridNode.call(this, {}); |
| 2508 this._parentView = parentView; | 2520 this._parentView = parentView; |
| 2509 this._request = request; | 2521 this._request = request; |
| 2510 this._linkifier = new WebInspector.Linkifier(); | 2522 this._linkifier = new WebInspector.Linkifier(); |
| 2511 this._isFilteredOut = true; | 2523 this._isFilteredOut = true; |
| 2512 this._isMatchingSearchQuery = false; | 2524 this._isMatchingSearchQuery = false; |
| 2513 } | 2525 } |
| 2514 | 2526 |
| 2515 WebInspector.NetworkDataGridNode.prototype = { | 2527 WebInspector.NetworkDataGridNode.prototype = { |
| 2528 /** | |
| 2529 * @override | |
| 2530 * @return {number} | |
| 2531 */ | |
| 2532 nodeSelfHeight: function() { | |
| 2533 return this._parentView.rowHeight(); | |
| 2534 }, | |
| 2535 | |
| 2516 /** override */ | 2536 /** override */ |
| 2517 createCells: function() | 2537 createCells: function() |
| 2518 { | 2538 { |
| 2519 this._nameCell = null; | 2539 this._nameCell = null; |
| 2520 this._timelineCell = null; | 2540 this._timelineCell = null; |
| 2521 | 2541 |
| 2522 var element = this._element; | 2542 var element = this._element; |
| 2523 element.classList.toggle("network-error-row", this._isFailed()); | 2543 element.classList.toggle("network-error-row", this._isFailed()); |
| 2524 element.classList.toggle("resource-cached", this._request.cached); | 2544 element.classList.toggle("resource-cached", this._request.cached); |
| 2525 var typeClassName = "network-type-" + this._request.type.name(); | 2545 var typeClassName = "network-type-" + this._request.type.name(); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3038 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) | 3058 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) |
| 3039 { | 3059 { |
| 3040 var aValue = a._request[propertyName]; | 3060 var aValue = a._request[propertyName]; |
| 3041 var bValue = b._request[propertyName]; | 3061 var bValue = b._request[propertyName]; |
| 3042 if (aValue > bValue) | 3062 if (aValue > bValue) |
| 3043 return revert ? -1 : 1; | 3063 return revert ? -1 : 1; |
| 3044 if (bValue > aValue) | 3064 if (bValue > aValue) |
| 3045 return revert ? 1 : -1; | 3065 return revert ? 1 : -1; |
| 3046 return a._request.indentityCompare(b._request); | 3066 return a._request.indentityCompare(b._request); |
| 3047 } | 3067 } |
| OLD | NEW |