OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'package:observatory/models.dart' as M show Target; | 7 import 'package:observatory/models.dart' as M show Target; |
8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
9 import 'package:observatory/src/elements/helpers/tag.dart'; | 9 import 'package:observatory/src/elements/helpers/tag.dart'; |
10 import 'package:observatory/src/elements/helpers/uris.dart'; | 10 import 'package:observatory/src/elements/helpers/uris.dart'; |
11 | 11 |
12 class TargetEvent { | 12 class TargetEvent { |
13 final M.Target target; | 13 final M.Target target; |
14 | 14 |
15 TargetEvent(this.target); | 15 TargetEvent(this.target); |
16 } | 16 } |
17 | 17 |
18 class VMConnectTargetElement extends HtmlElement implements Renderable{ | 18 class VMConnectTargetElement extends HtmlElement implements Renderable { |
19 | 19 |
20 static const tag = | 20 static const tag = |
21 const Tag<VMConnectTargetElement>('vm-connect-target'); | 21 const Tag<VMConnectTargetElement>('vm-connect-target'); |
22 | 22 |
23 RenderingScheduler<VMConnectTargetElement> _r; | 23 RenderingScheduler<VMConnectTargetElement> _r; |
24 | 24 |
25 Stream<RenderedEvent<VMConnectTargetElement>> get onRendered => _r.onRendered; | 25 Stream<RenderedEvent<VMConnectTargetElement>> get onRendered => _r.onRendered; |
26 | 26 |
27 final StreamController<TargetEvent> _onConnect = | 27 final StreamController<TargetEvent> _onConnect = |
28 new StreamController<TargetEvent>.broadcast(); | 28 new StreamController<TargetEvent>.broadcast(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 TargetEvent _toEvent(_) { | 93 TargetEvent _toEvent(_) { |
94 return new TargetEvent(target); | 94 return new TargetEvent(target); |
95 } | 95 } |
96 | 96 |
97 static bool _filter(MouseEvent event) { | 97 static bool _filter(MouseEvent event) { |
98 return !(event.button > 0 || event.metaKey || event.ctrlKey || | 98 return !(event.button > 0 || event.metaKey || event.ctrlKey || |
99 event.shiftKey || event.altKey); | 99 event.shiftKey || event.altKey); |
100 } | 100 } |
101 } | 101 } |
OLD | NEW |