OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 var clientWidth = this._graphRowsElementWidth; | 128 var clientWidth = this._graphRowsElementWidth; |
129 var dividers = []; | 129 var dividers = []; |
130 var eventDividerRecords = this._model.eventDividerRecords(); | 130 var eventDividerRecords = this._model.eventDividerRecords(); |
131 | 131 |
132 for (var i = 0; i < eventDividerRecords.length; ++i) { | 132 for (var i = 0; i < eventDividerRecords.length; ++i) { |
133 var record = eventDividerRecords[i]; | 133 var record = eventDividerRecords[i]; |
134 var position = this._calculator.computePosition(record.startTime()); | 134 var position = this._calculator.computePosition(record.startTime()); |
135 var dividerPosition = Math.round(position); | 135 var dividerPosition = Math.round(position); |
136 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider
s[dividerPosition]) | 136 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider
s[dividerPosition]) |
137 continue; | 137 continue; |
138 var divider = WebInspector.TimelineUIUtils.createEventDivider(record
.type(), WebInspector.TimelineUIUtils.recordTitle(record, this._model)); | 138 var divider = this._uiUtils.createEventDivider(record.type(), record
.title()); |
139 divider.style.left = dividerPosition + "px"; | 139 divider.style.left = dividerPosition + "px"; |
140 dividers[dividerPosition] = divider; | 140 dividers[dividerPosition] = divider; |
141 } | 141 } |
142 this._timelineGrid.addEventDividers(dividers); | 142 this._timelineGrid.addEventDividers(dividers); |
143 }, | 143 }, |
144 | 144 |
145 _updateFrameBars: function(frames) | 145 _updateFrameBars: function(frames) |
146 { | 146 { |
147 var clientWidth = this._graphRowsElementWidth; | 147 var clientWidth = this._graphRowsElementWidth; |
148 if (this._frameContainer) { | 148 if (this._frameContainer) { |
(...skipping 25 matching lines...) Expand all Loading... |
174 frameStrip._frame = frame; | 174 frameStrip._frame = frame; |
175 this._frameStripByFrame.put(frame, frameStrip); | 175 this._frameStripByFrame.put(frame, frameStrip); |
176 | 176 |
177 const minWidthForFrameInfo = 60; | 177 const minWidthForFrameInfo = 60; |
178 if (width > minWidthForFrameInfo) | 178 if (width > minWidthForFrameInfo) |
179 frameStrip.textContent = Number.millisToString(frame.endTime - f
rame.startTime, true); | 179 frameStrip.textContent = Number.millisToString(frame.endTime - f
rame.startTime, true); |
180 | 180 |
181 this._frameContainer.appendChild(frameStrip); | 181 this._frameContainer.appendChild(frameStrip); |
182 | 182 |
183 if (actualStart > 0) { | 183 if (actualStart > 0) { |
184 var frameMarker = WebInspector.TimelineUIUtils.createEventDivide
r(WebInspector.TimelineModel.RecordType.BeginFrame); | 184 var frameMarker = this._uiUtils.createEventDivider(WebInspector.
TimelineModel.RecordType.BeginFrame); |
185 frameMarker.style.left = frameStart + "px"; | 185 frameMarker.style.left = frameStart + "px"; |
186 dividers.push(frameMarker); | 186 dividers.push(frameMarker); |
187 } | 187 } |
188 } | 188 } |
189 this._timelineGrid.addEventDividers(dividers); | 189 this._timelineGrid.addEventDividers(dividers); |
190 this._headerElement.appendChild(this._frameContainer); | 190 this._headerElement.appendChild(this._frameContainer); |
191 }, | 191 }, |
192 | 192 |
193 _onFrameDoubleClicked: function(event) | 193 _onFrameDoubleClicked: function(event) |
194 { | 194 { |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 this._element.classList.remove("hidden"); | 1294 this._element.classList.remove("hidden"); |
1295 } else | 1295 } else |
1296 this._element.classList.add("hidden"); | 1296 this._element.classList.add("hidden"); |
1297 }, | 1297 }, |
1298 | 1298 |
1299 _dispose: function() | 1299 _dispose: function() |
1300 { | 1300 { |
1301 this._element.remove(); | 1301 this._element.remove(); |
1302 } | 1302 } |
1303 } | 1303 } |
OLD | NEW |