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

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

Issue 928833003: Add Function based profile tree (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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: runtime/observatory/lib/src/elements/observatory_element.dart
diff --git a/runtime/observatory/lib/src/elements/observatory_element.dart b/runtime/observatory/lib/src/elements/observatory_element.dart
index 9e9a363d7f0f0e4ac61ab68d212c94b27a37144a..c0103a5bedc4a40e64797fb6a166834acf3f5f75 100644
--- a/runtime/observatory/lib/src/elements/observatory_element.dart
+++ b/runtime/observatory/lib/src/elements/observatory_element.dart
@@ -88,7 +88,12 @@ class ObservatoryElement extends PolymerElement {
/// Utility method for handling on-click of <a> tags. Navigates
/// within the application using the [LocationManager].
void goto(MouseEvent event, var detail, Element target) {
- app.locationManager.onGoto(event, detail, target);
+ app.locationManager.onGoto(event);
+ event.stopPropagation();
+ }
+
+ void onClickGoto(MouseEvent event) {
+ app.locationManager.onGoto(event);
event.stopPropagation();
}
@@ -97,8 +102,12 @@ class ObservatoryElement extends PolymerElement {
if (obj is Isolate) {
url = '${url}?isolateId=${Uri.encodeComponent(obj.id)}';
} else {
+ if (obj.id == null) {
+ // No id
+ return url;
+ }
url = ('${url}?isolateId=${Uri.encodeComponent(obj.isolate.id)}'
- '&objectId=${Uri.encodeComponent(obj.id)}');
+ '&objectId=${Uri.encodeComponent(obj.id)}');
}
}
return url;
@@ -151,4 +160,26 @@ class ObservatoryElement extends PolymerElement {
}
return new String.fromCharCodes(result);
}
+
+ void clearShadowRoot() {
+ // Remove all non-style elements.
+ shadowRoot.children.removeWhere((e) => e is! StyleElement);
+ }
+
+ void insertTextSpanIntoShadowRoot(String text) {
+ var spanElement = new SpanElement();
+ spanElement.text = text;
+ shadowRoot.children.add(spanElement);
+ }
+
+ void insertLinkIntoShadowRoot(String label, String href, [String title]) {
+ var anchorElement = new AnchorElement();
+ anchorElement.href = href;
+ anchorElement.text = label;
+ if (title != null) {
+ anchorElement.title = title;
+ }
+ anchorElement.onClick.listen(onClickGoto);
+ shadowRoot.children.add(anchorElement);
+ }
}
« no previous file with comments | « runtime/observatory/lib/src/elements/heap_profile.dart ('k') | runtime/observatory/lib/src/elements/script_ref.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698