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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js

Issue 2436953003: [Devtools] Highlight navigation request in network timeline exp (Closed)
Patch Set: [Devtools] Highlight navigation request in network timeline exp Created 4 years, 2 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 | « third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js ('k') | 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @param {number} rowHeight 8 * @param {number} rowHeight
9 * @param {number} headerHeight 9 * @param {number} headerHeight
10 * @param {!WebInspector.NetworkTransferTimeCalculator} calculator 10 * @param {!WebInspector.NetworkTransferTimeCalculator} calculator
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // TODO(allada) When timeline canvas moves out of experiment move this to st ylesheet. 51 // TODO(allada) When timeline canvas moves out of experiment move this to st ylesheet.
52 this._boundScrollContainer.style.overflow = "hidden"; 52 this._boundScrollContainer.style.overflow = "hidden";
53 53
54 /** @type {!Array<!WebInspector.NetworkRequest>} */ 54 /** @type {!Array<!WebInspector.NetworkRequest>} */
55 this._requestData = []; 55 this._requestData = [];
56 56
57 /** @type {?WebInspector.NetworkRequest} */ 57 /** @type {?WebInspector.NetworkRequest} */
58 this._hoveredRequest = null; 58 this._hoveredRequest = null;
59 59
60 this._rowStripeColor = WebInspector.themeSupport.patchColor("#f5f5f5", WebIn spector.ThemeSupport.ColorUsage.Background); 60 /** @type {?WebInspector.NetworkRequest} */
61 this._rowHoverColor = WebInspector.themeSupport.patchColor("#ebf2fc", WebIns pector.ThemeSupport.ColorUsage.Background); 61 this._navigationRequest = null;
62
63 var colorUsage = WebInspector.ThemeSupport.ColorUsage;
64 this._rowNavigationRequestColor = WebInspector.themeSupport.patchColor("#def ", colorUsage.Background);
65 this._rowStripeColor = WebInspector.themeSupport.patchColor("#f5f5f5", color Usage.Background);
66 this._rowHoverColor = WebInspector.themeSupport.patchColor("#ebf2fc", /** @t ype {!WebInspector.ThemeSupport.ColorUsage} */ (colorUsage.Background | colorUsa ge.Selection));
allada 2016/10/20 23:30:43 I found this bug and figured to change it here whi
62 67
63 /** @type {!Map<!WebInspector.ResourceType, string>} */ 68 /** @type {!Map<!WebInspector.ResourceType, string>} */
64 this._borderColorsForResourceTypeCache = new Map(); 69 this._borderColorsForResourceTypeCache = new Map();
65 /** @type {!Map<string, !CanvasGradient>} */ 70 /** @type {!Map<string, !CanvasGradient>} */
66 this._colorsForResourceTypeCache = new Map(); 71 this._colorsForResourceTypeCache = new Map();
67 } 72 }
68 73
69 WebInspector.NetworkTimelineColumn.Events = { 74 WebInspector.NetworkTimelineColumn.Events = {
70 RequestHovered: Symbol("RequestHovered") 75 RequestHovered: Symbol("RequestHovered")
71 } 76 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 /** 149 /**
145 * @return {!Element} 150 * @return {!Element}
146 */ 151 */
147 getScrollContainer: function() 152 getScrollContainer: function()
148 { 153 {
149 return this._vScrollElement; 154 return this._vScrollElement;
150 }, 155 },
151 156
152 /** 157 /**
153 * @param {!Array<!WebInspector.NetworkRequest>} requests 158 * @param {!Array<!WebInspector.NetworkRequest>} requests
159 * @param {?WebInspector.NetworkRequest} navigationRequest
154 */ 160 */
155 setRequests: function(requests) 161 setRequests: function(requests, navigationRequest)
156 { 162 {
163 this._navigationRequest = navigationRequest;
157 this._requestData = requests; 164 this._requestData = requests;
158 }, 165 },
159 166
160 /** 167 /**
161 * @param {?WebInspector.NetworkRequest} request 168 * @param {?WebInspector.NetworkRequest} request
162 */ 169 */
163 setHoveredRequest: function(request) 170 setHoveredRequest: function(request)
164 { 171 {
165 this._hoveredRequest = request; 172 this._hoveredRequest = request;
166 this.scheduleDraw(); 173 this.scheduleDraw();
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 }, 613 },
607 614
608 /** 615 /**
609 * @param {!CanvasRenderingContext2D} context 616 * @param {!CanvasRenderingContext2D} context
610 * @param {!WebInspector.NetworkRequest} request 617 * @param {!WebInspector.NetworkRequest} request
611 * @param {number} rowNumber 618 * @param {number} rowNumber
612 * @param {number} y 619 * @param {number} y
613 */ 620 */
614 _decorateRow: function(context, request, rowNumber, y) 621 _decorateRow: function(context, request, rowNumber, y)
615 { 622 {
616 if (rowNumber % 2 === 1 && this._hoveredRequest !== request) 623 if (rowNumber % 2 === 1 && this._hoveredRequest !== request && this._nav igationRequest !== request)
617 return; 624 return;
618 context.save(); 625 context.save();
619 context.beginPath(); 626 context.beginPath();
620 var color = this._rowStripeColor; 627 var color = this._rowStripeColor;
621 if (this._hoveredRequest === request) 628 if (this._hoveredRequest === request)
622 color = this._rowHoverColor; 629 color = this._rowHoverColor;
630 else if (this._navigationRequest === request)
631 color = this._rowNavigationRequestColor;
623 632
624 context.fillStyle = color; 633 context.fillStyle = color;
625 context.rect(0, y, this._offsetWidth, this._rowHeight); 634 context.rect(0, y, this._offsetWidth, this._rowHeight);
626 context.fill(); 635 context.fill();
627 context.restore(); 636 context.restore();
628 }, 637 },
629 638
630 __proto__: WebInspector.VBox.prototype 639 __proto__: WebInspector.VBox.prototype
631 } 640 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698