OLD | NEW |
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 var colorUsage = WebInspector.ThemeSupport.ColorUsage; | 63 var colorUsage = WebInspector.ThemeSupport.ColorUsage; |
64 this._rowNavigationRequestColor = WebInspector.themeSupport.patchColor("#def
", colorUsage.Background); | 64 this._rowNavigationRequestColor = WebInspector.themeSupport.patchColor("#def
", colorUsage.Background); |
65 this._rowStripeColor = WebInspector.themeSupport.patchColor("#f5f5f5", color
Usage.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)); | 66 this._rowHoverColor = WebInspector.themeSupport.patchColor("#ebf2fc", /** @t
ype {!WebInspector.ThemeSupport.ColorUsage} */ (colorUsage.Background | colorUsa
ge.Selection)); |
67 | 67 |
68 /** @type {!Map<!WebInspector.ResourceType, string>} */ | 68 /** @type {!Map<!WebInspector.ResourceType, string>} */ |
69 this._borderColorsForResourceTypeCache = new Map(); | 69 this._borderColorsForResourceTypeCache = new Map(); |
70 /** @type {!Map<string, !CanvasGradient>} */ | 70 /** @type {!Map<string, !CanvasGradient>} */ |
71 this._colorsForResourceTypeCache = new Map(); | 71 this._colorsForResourceTypeCache = new Map(); |
72 } | 72 }; |
73 | 73 |
74 WebInspector.NetworkTimelineColumn.Events = { | 74 WebInspector.NetworkTimelineColumn.Events = { |
75 RequestHovered: Symbol("RequestHovered") | 75 RequestHovered: Symbol("RequestHovered") |
76 } | 76 }; |
77 | 77 |
78 WebInspector.NetworkTimelineColumn._colorsForResourceType = { | 78 WebInspector.NetworkTimelineColumn._colorsForResourceType = { |
79 document: "hsl(215, 100%, 80%)", | 79 document: "hsl(215, 100%, 80%)", |
80 font: "hsl(8, 100%, 80%)", | 80 font: "hsl(8, 100%, 80%)", |
81 media: "hsl(272, 64%, 80%)", | 81 media: "hsl(272, 64%, 80%)", |
82 image: "hsl(272, 64%, 80%)", | 82 image: "hsl(272, 64%, 80%)", |
83 script: "hsl(31, 100%, 80%)", | 83 script: "hsl(31, 100%, 80%)", |
84 stylesheet: "hsl(90, 50%, 80%)", | 84 stylesheet: "hsl(90, 50%, 80%)", |
85 texttrack: "hsl(8, 100%, 80%)", | 85 texttrack: "hsl(8, 100%, 80%)", |
86 websocket: "hsl(0, 0%, 95%)", | 86 websocket: "hsl(0, 0%, 95%)", |
87 xhr: "hsl(53, 100%, 80%)", | 87 xhr: "hsl(53, 100%, 80%)", |
88 other: "hsl(0, 0%, 95%)" | 88 other: "hsl(0, 0%, 95%)" |
89 } | 89 }; |
90 | 90 |
91 WebInspector.NetworkTimelineColumn.prototype = { | 91 WebInspector.NetworkTimelineColumn.prototype = { |
92 /** | 92 /** |
93 * @override | 93 * @override |
94 */ | 94 */ |
95 willHide: function() | 95 willHide: function() |
96 { | 96 { |
97 this._popoverHelper.hidePopover(); | 97 this._popoverHelper.hidePopover(); |
98 }, | 98 }, |
99 | 99 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 var logGridSliceTime = Math.ceil(Math.log(gridSliceTime) / Math.LN10); | 384 var logGridSliceTime = Math.ceil(Math.log(gridSliceTime) / Math.LN10); |
385 gridSliceTime = Math.pow(10, logGridSliceTime); | 385 gridSliceTime = Math.pow(10, logGridSliceTime); |
386 if (gridSliceTime * pixelsPerTime >= 5 * minGridSlicePx) | 386 if (gridSliceTime * pixelsPerTime >= 5 * minGridSlicePx) |
387 gridSliceTime = gridSliceTime / 5; | 387 gridSliceTime = gridSliceTime / 5; |
388 if (gridSliceTime * pixelsPerTime >= 2 * minGridSlicePx) | 388 if (gridSliceTime * pixelsPerTime >= 2 * minGridSlicePx) |
389 gridSliceTime = gridSliceTime / 2; | 389 gridSliceTime = gridSliceTime / 2; |
390 | 390 |
391 context.lineWidth = 1; | 391 context.lineWidth = 1; |
392 context.strokeStyle = "rgba(0, 0, 0, .1)"; | 392 context.strokeStyle = "rgba(0, 0, 0, .1)"; |
393 context.font = this._fontSize + "px sans-serif"; | 393 context.font = this._fontSize + "px sans-serif"; |
394 context.fillStyle = "#444" | 394 context.fillStyle = "#444"; |
395 gridSliceTime = gridSliceTime; | 395 gridSliceTime = gridSliceTime; |
396 for (var position = gridSliceTime * pixelsPerTime; position < drawableWi
dth; position += gridSliceTime * pixelsPerTime) { | 396 for (var position = gridSliceTime * pixelsPerTime; position < drawableWi
dth; position += gridSliceTime * pixelsPerTime) { |
397 // Added .5 because canvas drawing points are between pixels. | 397 // Added .5 because canvas drawing points are between pixels. |
398 var drawPosition = Math.floor(position) + this._leftPadding + .5; | 398 var drawPosition = Math.floor(position) + this._leftPadding + .5; |
399 context.beginPath(); | 399 context.beginPath(); |
400 context.moveTo(drawPosition, 0); | 400 context.moveTo(drawPosition, 0); |
401 context.lineTo(drawPosition, this._offsetHeight); | 401 context.lineTo(drawPosition, this._offsetHeight); |
402 context.stroke(); | 402 context.stroke(); |
403 if (position <= gridSliceTime * pixelsPerTime) | 403 if (position <= gridSliceTime * pixelsPerTime) |
404 continue; | 404 continue; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 else if (this._navigationRequest === request) | 638 else if (this._navigationRequest === request) |
639 color = this._rowNavigationRequestColor; | 639 color = this._rowNavigationRequestColor; |
640 | 640 |
641 context.fillStyle = color; | 641 context.fillStyle = color; |
642 context.rect(0, y, this._offsetWidth, this._rowHeight); | 642 context.rect(0, y, this._offsetWidth, this._rowHeight); |
643 context.fill(); | 643 context.fill(); |
644 context.restore(); | 644 context.restore(); |
645 }, | 645 }, |
646 | 646 |
647 __proto__: WebInspector.VBox.prototype | 647 __proto__: WebInspector.VBox.prototype |
648 } | 648 }; |
OLD | NEW |