OLD | NEW |
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 timeline_page_element; | 5 library timeline_page_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:html'; | 9 import 'dart:html'; |
10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Future refresh() async { | 50 Future refresh() async { |
51 return postMessage('refresh'); | 51 return postMessage('refresh'); |
52 } | 52 } |
53 | 53 |
54 Future clear() async { | 54 Future clear() async { |
55 await app.vm.invokeRpc('_clearVMTimeline', {}); | 55 await app.vm.invokeRpc('_clearVMTimeline', {}); |
56 return postMessage('clear'); | 56 return postMessage('clear'); |
57 } | 57 } |
58 | 58 |
59 Future recordOn() async { | 59 Future recordOn() async { |
60 return app.vm.invokeRpc('_setVMTimelineFlag', { | 60 return app.vm.invokeRpc('_setVMTimelineFlags', { |
61 '_record': 'all', | 61 'recordedStreams': ['all'], |
62 }); | 62 }); |
63 } | 63 } |
64 | 64 |
65 Future recordOff() async { | 65 Future recordOff() async { |
66 return app.vm.invokeRpc('_setVMTimelineFlag', { | 66 return app.vm.invokeRpc('_setVMTimelineFlags', { |
67 '_record': 'none', | 67 'recordedStreams': [], |
68 }); | 68 }); |
69 } | 69 } |
70 | 70 |
71 _updateSize() { | 71 _updateSize() { |
72 IFrameElement e = $['root']; | 72 IFrameElement e = $['root']; |
73 final totalHeight = window.innerHeight; | 73 final totalHeight = window.innerHeight; |
74 final top = e.offset.top; | 74 final top = e.offset.top; |
75 final bottomMargin = 32; | 75 final bottomMargin = 32; |
76 final mainHeight = totalHeight - top - bottomMargin; | 76 final mainHeight = totalHeight - top - bottomMargin; |
77 e.style.setProperty('height', '${mainHeight}px'); | 77 e.style.setProperty('height', '${mainHeight}px'); |
78 e.style.setProperty('width', '100%'); | 78 e.style.setProperty('width', '100%'); |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 StreamSubscription _resizeSubscription; | 82 StreamSubscription _resizeSubscription; |
83 } | 83 } |
OLD | NEW |