OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library function_ref_element; | 5 library function_ref_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/models.dart' as M | 9 import 'package:observatory/models.dart' as M |
10 show IsolateRef, FunctionRef, isSyntheticFunction, ClassRef, ObjectRef; | 10 show IsolateRef, FunctionRef, isSyntheticFunction, ClassRef, ObjectRef; |
| 11 import 'package:observatory/src/elements/class_ref.dart'; |
11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
12 import 'package:observatory/src/elements/helpers/tag.dart'; | 13 import 'package:observatory/src/elements/helpers/tag.dart'; |
13 import 'package:observatory/src/elements/helpers/uris.dart'; | 14 import 'package:observatory/src/elements/helpers/uris.dart'; |
14 | 15 |
15 class FunctionRefElement extends HtmlElement implements Renderable { | 16 class FunctionRefElement extends HtmlElement implements Renderable { |
16 static const tag = const Tag<FunctionRefElement>('function-ref-wrapped'); | 17 static const tag = const Tag<FunctionRefElement>('function-ref-wrapped'); |
17 | 18 |
18 RenderingScheduler<FunctionRefElement> _r; | 19 RenderingScheduler<FunctionRefElement> _r; |
19 | 20 |
20 Stream<RenderedEvent<FunctionRefElement>> get onRendered => _r.onRendered; | 21 Stream<RenderedEvent<FunctionRefElement>> get onRendered => _r.onRendered; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 new SpanElement()..text = '.', | 70 new SpanElement()..text = '.', |
70 new AnchorElement(href: M.isSyntheticFunction(function.kind) ? null | 71 new AnchorElement(href: M.isSyntheticFunction(function.kind) ? null |
71 : Uris.inspect(_isolate, object: function)) | 72 : Uris.inspect(_isolate, object: function)) |
72 ..text = function.name | 73 ..text = function.name |
73 ]); | 74 ]); |
74 owner = function.dartOwner; | 75 owner = function.dartOwner; |
75 } | 76 } |
76 if (owner is M.ClassRef) { | 77 if (owner is M.ClassRef) { |
77 content.addAll([ | 78 content.addAll([ |
78 new SpanElement()..text = '.', | 79 new SpanElement()..text = '.', |
79 new AnchorElement(href: Uris.inspect(_isolate, object: owner)) | 80 new ClassRefElement(_isolate, owner, queue: _r.queue) |
80 ..text = owner.name | |
81 ]); | 81 ]); |
82 } | 82 } |
83 } | 83 } |
84 children = content.reversed.toList(growable: false); | 84 children = content.reversed.toList(growable: false); |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |