| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'recordedStreams': ['all'], | 60 'recordedStreams': ['all'], |
| 61 }); | 61 }); |
| 62 } | 62 } |
| 63 | 63 |
| 64 Future recordOff() async { | 64 Future recordOff() async { |
| 65 return app.vm.invokeRpc('_setVMTimelineFlags', { | 65 return app.vm.invokeRpc('_setVMTimelineFlags', { |
| 66 'recordedStreams': [], | 66 'recordedStreams': [], |
| 67 }); | 67 }); |
| 68 } | 68 } |
| 69 | 69 |
| 70 Future saveTimeline() async { |
| 71 return postMessage('save'); |
| 72 } |
| 73 |
| 74 Future loadTimeline() async { |
| 75 return postMessage('load'); |
| 76 } |
| 77 |
| 70 _updateSize() { | 78 _updateSize() { |
| 71 IFrameElement e = $['root']; | 79 IFrameElement e = $['root']; |
| 72 final totalHeight = window.innerHeight; | 80 final totalHeight = window.innerHeight; |
| 73 final top = e.offset.top; | 81 final top = e.offset.top; |
| 74 final bottomMargin = 32; | 82 final bottomMargin = 32; |
| 75 final mainHeight = totalHeight - top - bottomMargin; | 83 final mainHeight = totalHeight - top - bottomMargin; |
| 76 e.style.setProperty('height', '${mainHeight}px'); | 84 e.style.setProperty('height', '${mainHeight}px'); |
| 77 e.style.setProperty('width', '100%'); | 85 e.style.setProperty('width', '100%'); |
| 78 } | 86 } |
| 79 | 87 |
| 80 | 88 |
| 81 StreamSubscription _resizeSubscription; | 89 StreamSubscription _resizeSubscription; |
| 82 } | 90 } |
| OLD | NEW |