OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <import src="/sky/framework/elements/sky-element.sky" /> | 6 <import src="/sky/framework/elements/sky-element.sky" /> |
7 <import src="/sky/framework/elements/sky-scrollable.sky" /> | 7 <import src="/sky/framework/elements/sky-scrollable.sky" /> |
8 <sky-element> | 8 <sky-element> |
9 <template> | 9 <template> |
10 <style> | 10 <style> |
11 #control { | 11 #control { |
12 height: -webkit-fill-available; | 12 height: -webkit-fill-available; |
13 background-color: black; | 13 background-color: black; |
14 color: rgb(255, 191, 0); | 14 color: rgb(255, 191, 0); |
15 font-family: 'Courier', 'monospace'; | 15 font-family: 'Courier', 'monospace'; |
16 } | 16 } |
17 .line { | 17 .line { |
18 white-space: pre; | 18 white-space: pre; |
19 } | 19 } |
20 </style> | 20 </style> |
21 <sky-scrollable id="control" contenteditable /> | 21 <sky-scrollable id="control" contenteditable /> |
22 </template> | 22 </template> |
23 <script> | 23 <script> |
24 import 'dart:async'; | 24 import 'dart:async'; |
25 import 'dart:core'; | 25 import 'dart:core'; |
26 import 'dart:sky'; | 26 import 'dart:sky'; |
27 import 'package:examples/echo_terminal/terminal_client.mojom.dart' as terminal; | 27 import 'package:mojo/services/terminal/public/interfaces/terminal_client.mojom.d
art' as terminal; |
28 import '/sky/framework/embedder.dart'; | 28 import 'package:sky/framework/embedder.dart'; |
29 import 'terminal_display.dart'; | 29 import 'terminal_display.dart'; |
30 import 'terminal_file_impl.dart'; | 30 import 'terminal_file_impl.dart'; |
31 | 31 |
32 // Implements the <terminal> element, which implements a "terminal display". Has | 32 // Implements the <terminal> element, which implements a "terminal display". Has |
33 // an |url| attribute, whose value should be a Mojo app that provides the | 33 // an |url| attribute, whose value should be a Mojo app that provides the |
34 // |terminal.TerminalClient| service. | 34 // |terminal.TerminalClient| service. |
35 @Tagname('terminal') | 35 @Tagname('terminal') |
36 class TerminalDisplayImpl extends SkyElement implements TerminalDisplay { | 36 class TerminalDisplayImpl extends SkyElement implements TerminalDisplay { |
37 Element _control; | 37 Element _control; |
38 | 38 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 var completer = new Completer<int>(); | 158 var completer = new Completer<int>(); |
159 _readerQueue.add(completer); | 159 _readerQueue.add(completer); |
160 return completer.future; | 160 return completer.future; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 _init(script) => register(script, TerminalDisplayImpl); | 164 _init(script) => register(script, TerminalDisplayImpl); |
165 </script> | 165 </script> |
166 </sky-element> | 166 </sky-element> |
OLD | NEW |