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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/perf_ui/FlameChart.js

Issue 2782953002: DevTools: Make EntryHighlighted an event rather than method on data provider (Closed)
Patch Set: clean up Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 /** 160 /**
161 * @param {number} entryIndex 161 * @param {number} entryIndex
162 */ 162 */
163 highlightEntry(entryIndex) { 163 highlightEntry(entryIndex) {
164 if (this._highlightedEntryIndex === entryIndex) 164 if (this._highlightedEntryIndex === entryIndex)
165 return; 165 return;
166 this._highlightedEntryIndex = entryIndex; 166 this._highlightedEntryIndex = entryIndex;
167 this._updateElementPosition(this._highlightElement, this._highlightedEntryIn dex); 167 this._updateElementPosition(this._highlightElement, this._highlightedEntryIn dex);
168 this._dataProvider.highlightEntry(entryIndex); 168 this.dispatchEventToListeners(PerfUI.FlameChart.Events.EntryHighlighted, ent ryIndex);
169 } 169 }
170 170
171 hideHighlight() { 171 hideHighlight() {
172 this._entryInfo.removeChildren(); 172 this._entryInfo.removeChildren();
173 this._highlightedEntryIndex = -1; 173 this._highlightedEntryIndex = -1;
174 this._updateElementPosition(this._highlightElement, this._highlightedEntryIn dex); 174 this._updateElementPosition(this._highlightElement, this._highlightedEntryIn dex);
175 this._dataProvider.highlightEntry(-1); 175 this.dispatchEventToListeners(PerfUI.FlameChart.Events.EntryHighlighted, -1) ;
176 } 176 }
177 177
178 _resetCanvas() { 178 _resetCanvas() {
179 var ratio = window.devicePixelRatio; 179 var ratio = window.devicePixelRatio;
180 this._canvas.width = this._offsetWidth * ratio; 180 this._canvas.width = this._offsetWidth * ratio;
181 this._canvas.height = this._offsetHeight * ratio; 181 this._canvas.height = this._offsetHeight * ratio;
182 this._canvas.style.width = this._offsetWidth + 'px'; 182 this._canvas.style.width = this._offsetWidth + 'px';
183 this._canvas.style.height = this._offsetHeight + 'px'; 183 this._canvas.style.height = this._offsetHeight + 'px';
184 } 184 }
185 185
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 * @param {number} barWidth 1407 * @param {number} barWidth
1408 * @param {number} barHeight 1408 * @param {number} barHeight
1409 * @param {number} unclippedBarX 1409 * @param {number} unclippedBarX
1410 * @param {number} timeToPixels 1410 * @param {number} timeToPixels
1411 * @return {boolean} 1411 * @return {boolean}
1412 */ 1412 */
1413 decorateEntry(entryIndex, context, text, barX, barY, barWidth, barHeight, uncl ippedBarX, timeToPixels) {}, 1413 decorateEntry(entryIndex, context, text, barX, barY, barWidth, barHeight, uncl ippedBarX, timeToPixels) {},
1414 1414
1415 /** 1415 /**
1416 * @param {number} entryIndex 1416 * @param {number} entryIndex
1417 */
1418 highlightEntry(entryIndex) {},
1419
1420 /**
1421 * @param {number} entryIndex
1422 * @return {boolean} 1417 * @return {boolean}
1423 */ 1418 */
1424 forceDecoration(entryIndex) {}, 1419 forceDecoration(entryIndex) {},
1425 1420
1426 /** 1421 /**
1427 * @param {number} entryIndex 1422 * @param {number} entryIndex
1428 * @return {string} 1423 * @return {string}
1429 */ 1424 */
1430 textColor(entryIndex) {}, 1425 textColor(entryIndex) {},
1431 }; 1426 };
(...skipping 23 matching lines...) Expand all
1455 * @param {!CanvasRenderingContext2D} context 1450 * @param {!CanvasRenderingContext2D} context
1456 * @param {number} x 1451 * @param {number} x
1457 * @param {number} height 1452 * @param {number} height
1458 * @param {number} pixelsPerMillisecond 1453 * @param {number} pixelsPerMillisecond
1459 */ 1454 */
1460 draw(context, x, height, pixelsPerMillisecond) {}, 1455 draw(context, x, height, pixelsPerMillisecond) {},
1461 }; 1456 };
1462 1457
1463 /** @enum {symbol} */ 1458 /** @enum {symbol} */
1464 PerfUI.FlameChart.Events = { 1459 PerfUI.FlameChart.Events = {
1465 EntrySelected: Symbol('EntrySelected') 1460 EntrySelected: Symbol('EntrySelected'),
1461 EntryHighlighted: Symbol('EntryHighlighted')
1466 }; 1462 };
1467 1463
1468 /** 1464 /**
1469 * @unrestricted 1465 * @unrestricted
1470 */ 1466 */
1471 PerfUI.FlameChart.ColorGenerator = class { 1467 PerfUI.FlameChart.ColorGenerator = class {
1472 /** 1468 /**
1473 * @param {!{min: number, max: number}|number=} hueSpace 1469 * @param {!{min: number, max: number}|number=} hueSpace
1474 * @param {!{min: number, max: number, count: (number|undefined)}|number=} sat Space 1470 * @param {!{min: number, max: number, count: (number|undefined)}|number=} sat Space
1475 * @param {!{min: number, max: number, count: (number|undefined)}|number=} lig htnessSpace 1471 * @param {!{min: number, max: number, count: (number|undefined)}|number=} lig htnessSpace
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 } 1597 }
1602 1598
1603 /** 1599 /**
1604 * @override 1600 * @override
1605 * @return {number} 1601 * @return {number}
1606 */ 1602 */
1607 boundarySpan() { 1603 boundarySpan() {
1608 return this._maximumBoundaries - this._minimumBoundaries; 1604 return this._maximumBoundaries - this._minimumBoundaries;
1609 } 1605 }
1610 }; 1606 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698