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

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

Issue 2154413002: Converted Observatory view-footer element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Splitted attached and detached in multiple lines 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 view_footer_element; 5 library view_footer_element;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'dart:html';
8 import 'observatory_element.dart'; 8 import 'dart:async';
9 import 'package:observatory/src/elements/helpers/tag.dart';
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
9 11
10 @CustomTag('view-footer') 12 class ViewFooterElement extends HtmlElement implements Renderable {
11 class ViewFooterElement extends ObservatoryElement { 13 static const tag = const Tag<ViewFooterElement>('view-footer');
12 ViewFooterElement.created() : super.created(); 14
15 RenderingScheduler _r;
16
17 Stream<RenderedEvent<ViewFooterElement>> get onRendered => _r.onRendered;
18
19 factory ViewFooterElement({RenderingQueue queue}) {
20 ViewFooterElement e = document.createElement(tag.name);
21 e._r = new RenderingScheduler(e, queue: queue);
22 return e;
23 }
24
25 ViewFooterElement.created() : super.created() {
26 // TODO(cbernaschina) remove this when no more needed.
27 _r = new RenderingScheduler(this);
28 }
29
30 @override
31 void attached() {
32 super.attached();
33 _r.enable();
34 }
35
36 @override
37 void detached() {
38 super.detached();
39 _r.disable(notify: true);
40 children = [];
41 }
42
43 void render() {
44 children = [
45 new AnchorElement()
46 ..href = 'https://www.dartlang.org/tools/observatory'
47 ..text = 'View documentation',
48 new AnchorElement()
49 ..href = 'https://github.com/dart-lang/sdk/issues/new?title=Observator y:&amp;body=Observatory%20Feedback'
50 ..text = 'File a bug report'
51 ];
52 }
13 } 53 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/service_view.html ('k') | runtime/observatory/lib/src/elements/view_footer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698