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

Unified Diff: Source/devtools/front_end/TimelineUIUtils.js

Issue 220963002: DevTools: Add energy value under Timeline pie chart (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add to Pie Chart Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/TimelineUIUtils.js
diff --git a/Source/devtools/front_end/TimelineUIUtils.js b/Source/devtools/front_end/TimelineUIUtils.js
index b7c73e81f7d4aaae5f6aa1da63562c13a02eff34..7765ee45f1ea6886383afc842d3703309a5fd348 100644
--- a/Source/devtools/front_end/TimelineUIUtils.js
+++ b/Source/devtools/front_end/TimelineUIUtils.js
@@ -295,9 +295,10 @@ WebInspector.TimelineUIUtils._generateAggregatedInfo = function(aggregatedStats)
* @param {!Object} aggregatedStats
* @param {!WebInspector.TimelineCategory=} selfCategory
* @param {number=} selfTime
+ * @param {number=} energy
* @return {!Element}
*/
-WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCategory, selfTime)
+WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCategory, selfTime, energy)
{
var element = document.createElement("div");
element.className = "timeline-aggregated-info";
@@ -346,6 +347,12 @@ WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCa
rowElement.createChild("div", "timeline-aggregated-category timeline-" + category.name);
rowElement.createTextChild(WebInspector.UIString("%s %s", formatter(value), category.title));
}
+
+ if (energy) {
+ var rowElement = footerElement.createChild("div");
+ rowElement.createChild("div", "timeline-aggregated-category timeline-" + "power");
alph 2014/04/09 16:02:27 what does this div do? Is it empty?
+ rowElement.createTextChild(WebInspector.UIString("%0.2f joules %s", energy, "Energy"));
alph 2014/04/09 16:02:27 %.2f Why not just put "Energy" inside the UIStrin
+ }
return element;
}

Powered by Google App Engine
This is Rietveld 408576698