Index: runtime/observatory/lib/src/elements/nav/vm_menu_wrapper.dart |
diff --git a/runtime/observatory/lib/src/elements/nav/isolate_menu_wrapper.dart b/runtime/observatory/lib/src/elements/nav/vm_menu_wrapper.dart |
similarity index 56% |
copy from runtime/observatory/lib/src/elements/nav/isolate_menu_wrapper.dart |
copy to runtime/observatory/lib/src/elements/nav/vm_menu_wrapper.dart |
index c2cf8f3d15b1b0d01e8258f05cdc6011dcb630eb..ef71b2dd4bed179e01a8c2efed0d1a06271beafc 100644 |
--- a/runtime/observatory/lib/src/elements/nav/isolate_menu_wrapper.dart |
+++ b/runtime/observatory/lib/src/elements/nav/vm_menu_wrapper.dart |
@@ -6,38 +6,36 @@ import 'dart:html'; |
import 'dart:async'; |
import 'package:observatory/app.dart'; |
-import 'package:observatory/service.dart'; |
import 'package:observatory/mocks.dart'; |
import 'package:observatory/models.dart' as M; |
+import 'package:observatory/service.dart'; |
+import 'package:observatory/service_common.dart'; |
import 'package:observatory/src/elements/helpers/tag.dart'; |
import 'package:observatory/src/elements/shims/binding.dart'; |
-import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
+import 'package:observatory/src/elements/nav/vm_menu.dart'; |
-class NavIsolateMenuElementWrapper extends HtmlElement { |
- static final binder = new Binder<NavIsolateMenuElementWrapper>( |
- const [const Binding('last'), const Binding('isolate')]); |
+class NavVMMenuElementWrapper extends HtmlElement { |
+ static final binder = new Binder<NavVMMenuElementWrapper>( |
+ const [const Binding('last'), const Binding('vm')]); |
- static const tag = |
- const Tag<NavIsolateMenuElementWrapper>('isolate-nav-menu'); |
+ static const tag = const Tag<NavVMMenuElementWrapper>('vm-nav-menu'); |
- final StreamController<M.IsolateUpdateEvent> _updatesController = |
- new StreamController<M.IsolateUpdateEvent>(); |
- Stream<M.IsolateUpdateEvent> _updates; |
StreamSubscription _subscription; |
+ StreamController<M.VMUpdateEvent> _updatesController = |
+ new StreamController<M.VMUpdateEvent>.broadcast(); |
bool _last = false; |
- Isolate _isolate; |
+ VM _vm; |
bool get last => _last; |
- Isolate get isolate => _isolate; |
+ VM get vm => _vm; |
set last(bool value) { |
_last = value; render(); |
} |
- set isolate(Isolate value) { |
- _isolate = value; _detached(); _attached(); |
+ set vm(VM value) { |
+ _vm = value; _detached(); _attached(); |
} |
- NavIsolateMenuElementWrapper.created() : super.created() { |
- _updates = _updatesController.stream.asBroadcastStream(); |
+ NavVMMenuElementWrapper.created() : super.created() { |
binder.registerCallback(this); |
_last = _getBoolAttribute('last'); |
createShadowRoot(); |
@@ -57,9 +55,9 @@ class NavIsolateMenuElementWrapper extends HtmlElement { |
} |
void _attached() { |
- if (_isolate != null) { |
- _subscription = _isolate.changes.listen((_) { |
- _updatesController.add(new IsolateUpdateEventMock(isolate: isolate)); |
+ if (_vm != null) { |
+ _subscription = _vm.changes.listen((_) { |
+ _updatesController.add(new VMUpdateEventMock(vm: _vm)); |
}); |
} |
render(); |
@@ -74,11 +72,12 @@ class NavIsolateMenuElementWrapper extends HtmlElement { |
void render() { |
shadowRoot.children = []; |
- if (_isolate == null || _last == null) return; |
+ if (_vm == null || _last == null) return; |
shadowRoot.children = [ |
- new NavIsolateMenuElement(isolate, _updates, last: last, |
- queue: ObservatoryApplication.app.queue) |
+ new NavVMMenuElement(vm, _updatesController.stream, last: last, |
+ target: (vm as CommonWebSocketVM)?.target, |
+ queue: ObservatoryApplication.app.queue) |
..children = [new ContentElement()] |
]; |
} |