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

Side by Side Diff: runtime/observatory/lib/src/elements/error_ref.dart

Issue 2119733003: Wrapping leaf nodes in non polymer elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted vm-connect Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 error_ref_element; 5 library error_ref_element;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'dart:html';
8 import 'service_ref.dart'; 8 import 'dart:async';
9 import 'package:observatory/models.dart'
10 show ErrorRef;
11 import 'package:observatory/src/elements/helpers/tag.dart';
12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
9 13
10 @CustomTag('error-ref') 14 class ErrorRefElement extends HtmlElement implements Renderable {
11 class ErrorRefElement extends ServiceRefElement { 15 static const tag = const Tag<ErrorRefElement>('error-ref-wrapped');
16
17 RenderingScheduler<ErrorRefElement> _r;
18
19 Stream<RenderedEvent<ErrorRefElement>> get onRendered => _r.onRendered;
20
21 ErrorRef _error;
22 ErrorRef get error => _error;
23
24 factory ErrorRefElement(ErrorRef error, {RenderingQueue queue}) {
25 assert(error != null);
26 ErrorRefElement e = document.createElement(tag.name);
27 e._r = new RenderingScheduler<ErrorRefElement>(e, queue: queue);
28 e._error = error;
29 return e;
30 }
31
12 ErrorRefElement.created() : super.created(); 32 ErrorRefElement.created() : super.created();
33
34 @override
35 void attached() { super.attached(); assert(error != null); _r.enable(); }
36
37 @override
38 void detached() { super.detached(); children = []; _r.disable(notify: true); }
39
40 void render() {
41 children = [
42 new PreElement()..text = error.message
43 ];
44 }
13 } 45 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/debugger.html ('k') | runtime/observatory/lib/src/elements/error_ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698