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

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

Issue 2204973003: Converted Observatory class-ref & library-ref elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed indentation Created 4 years, 4 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 | « runtime/observatory/lib/elements.html ('k') | runtime/observatory/lib/src/elements/class_ref.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/class_ref.dart
diff --git a/runtime/observatory/lib/src/elements/class_ref.dart b/runtime/observatory/lib/src/elements/class_ref.dart
index 2bf9e1d8088206d168d8155758f98d17f10575dc..d9940fbc206e237b5106a8081ff3143f00c166b7 100644
--- a/runtime/observatory/lib/src/elements/class_ref.dart
+++ b/runtime/observatory/lib/src/elements/class_ref.dart
@@ -4,33 +4,57 @@
library class_ref_element;
-import 'package:observatory/service.dart';
-import 'package:polymer/polymer.dart';
-import 'service_ref.dart';
+import 'dart:html';
import 'dart:async';
+import 'package:observatory/models.dart' as M
+ show IsolateRef, ClassRef;
+import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
+import 'package:observatory/src/elements/helpers/tag.dart';
+import 'package:observatory/src/elements/helpers/uris.dart';
-@CustomTag('class-ref')
-class ClassRefElement extends ServiceRefElement {
- @observable bool asValue = false;
+class ClassRefElement extends HtmlElement implements Renderable {
+ static const tag = const Tag<ClassRefElement>('class-ref-wrapped');
+
+ RenderingScheduler<ClassRefElement> _r;
+
+ Stream<RenderedEvent<ClassRefElement>> get onRendered => _r.onRendered;
+
+ M.IsolateRef _isolate;
+ M.ClassRef _class;
+
+ M.IsolateRef get isolate => _isolate;
+ M.ClassRef get cls => _class;
+
+ factory ClassRefElement(M.IsolateRef isolate, M.ClassRef cls,
+ {RenderingQueue queue}) {
+ assert(isolate != null);
+ assert(cls != null);
+ ClassRefElement e = document.createElement(tag.name);
+ e._r = new RenderingScheduler(e, queue: queue);
+ e._isolate = isolate;
+ e._class = cls;
+ return e;
+ }
ClassRefElement.created() : super.created();
- String makeExpandKey(String key) {
- return '${expandKey}/${key}';
+ @override
+ void attached() {
+ super.attached();
+ _r.enable();
}
- dynamic expander() {
- return expandEvent;
+ @override
+ void detached() {
+ super.detached();
+ _r.disable(notify: true);
+ children = [];
}
- void expandEvent(bool expand, Function onDone) {
- if (expand) {
- Class cls = ref;
- cls.reload().then((result) {
- return Future.wait(cls.fields.map((field) => field.reload()));
- }).whenComplete(onDone);
- } else {
- onDone();
- }
+ void render() {
+ children = [
+ new AnchorElement(href: Uris.inspect(_isolate, object: _class))
+ ..text = _class.name
+ ];
}
}
« no previous file with comments | « runtime/observatory/lib/elements.html ('k') | runtime/observatory/lib/src/elements/class_ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698