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

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

Issue 2180553002: Converted Observatory source-link & script-ref elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted Observatory source-link & script-ref elements Created 4 years, 4 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:html';
6 import 'dart:async';
7
8 import 'package:observatory/app.dart';
9 import 'package:observatory/service_html.dart' show Script;
10 import 'package:observatory/src/elements/script_ref.dart';
11 import 'package:observatory/src/elements/helpers/tag.dart';
12 import 'package:observatory/src/elements/shims/binding.dart';
13
14 @bindable
15 class ScriptRefElementWrapper extends HtmlElement {
16 static const binder = const Binder<ScriptRefElementWrapper>(const {
17 'ref': #ref
18 });
19
20 static const tag = const Tag<ScriptRefElementWrapper>('script-ref');
21
22 Script _script;
23 Script get ref => _script;
24 set ref(Script script) { _script = script; render(); }
25
26 ScriptRefElementWrapper.created() : super.created() {
27 binder.registerCallback(this);
28 createShadowRoot();
29 render();
30 }
31
32 @override
33 void attached() {
34 super.attached();
35 render();
36 }
37
38 Future render() async {
39 shadowRoot.children = [];
40 if (_script == null) return;
41
42 shadowRoot.children = [
43 new StyleElement()
44 ..text = '@import "packages/observatory/src/elements/css/shared.css";',
45 new ScriptRefElement(_script.isolate, _script,
46 queue: ObservatoryApplication.app.queue)
47 ];
48 }
49 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/script_ref.html ('k') | runtime/observatory/lib/src/elements/source_link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698