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

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1039863002: Call site data UI tweaks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/script_inset.dart
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index 2acb390da9b407633c73cbcee6b01649659c7632..1f57b2abeb9a4eb4bba5658204d982d620e992f9 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -19,17 +19,19 @@ void addInfoBox(content, infoBox) {
infoBox.style.border = 'solid black 2px';
infoBox.style.zIndex = '10';
infoBox.style.backgroundColor = 'white';
-
+ infoBox.style.cursor = 'auto';
infoBox.style.display = 'none'; // Initially hidden.
var show = false;
content.onClick.listen((event) {
show = !show;
infoBox.style.display = show ? 'block' : 'none';
+ content.style.backgroundColor = show ? 'white' : '';
});
// Causes infoBox to be positioned relative to the bottom-left of content.
content.style.display = 'inline-block';
+ content.style.cursor = 'pointer';
content.append(infoBox);
}
@@ -54,9 +56,10 @@ class CurrentExecutionAnnotation extends Annotation {
class CallSiteAnnotation extends Annotation {
CallSite callSite;
- Element row() {
+ Element row([content]) {
var e = new DivElement();
e.style.display = "table-row";
+ if (content is String) e.text = content;
return e;
}
@@ -81,18 +84,22 @@ class CallSiteAnnotation extends Annotation {
e.style.color = "#333";
e.style.font = "400 14px 'Montserrat', sans-serif";
- var r = row();
- r.append(cell("Container"));
- r.append(cell("Count"));
- r.append(cell("Target"));
- e.append(r);
-
- for (var entry in callSite.entries) {
+ if (callSite.entries.isEmpty) {
+ e.append(row('Did not execute'));
+ } else {
var r = row();
- r.append(cell(serviceRef(entry.receiverContainer)));
- r.append(cell(entry.count.toString()));
- r.append(cell(serviceRef(entry.target)));
+ r.append(cell("Container"));
+ r.append(cell("Count"));
+ r.append(cell("Target"));
e.append(r);
+
+ for (var entry in callSite.entries) {
+ var r = row();
+ r.append(cell(serviceRef(entry.receiverContainer)));
+ r.append(cell(entry.count.toString()));
+ r.append(cell(serviceRef(entry.target)));
+ e.append(r);
+ }
}
return e;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698