| 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 29 matching lines...) Expand all Loading... |
| 40 'params': { | 40 'params': { |
| 41 'vmAddress': (app.vm as WebSocketVM).target.networkAddress, | 41 'vmAddress': (app.vm as WebSocketVM).target.networkAddress, |
| 42 'isolateIds': isolateIds | 42 'isolateIds': isolateIds |
| 43 } | 43 } |
| 44 }; | 44 }; |
| 45 e.contentWindow.postMessage(JSON.encode(message), window.location.href); | 45 e.contentWindow.postMessage(JSON.encode(message), window.location.href); |
| 46 return null; | 46 return null; |
| 47 } | 47 } |
| 48 | 48 |
| 49 Future refresh() async { | 49 Future refresh() async { |
| 50 await app.vm.reload(); |
| 51 await app.vm.reloadIsolates(); |
| 50 return postMessage('refresh'); | 52 return postMessage('refresh'); |
| 51 } | 53 } |
| 52 | 54 |
| 53 Future clear() async { | 55 Future clear() async { |
| 54 await app.vm.invokeRpc('_clearVMTimeline', {}); | 56 await app.vm.invokeRpc('_clearVMTimeline', {}); |
| 55 return postMessage('clear'); | 57 return postMessage('clear'); |
| 56 } | 58 } |
| 57 | 59 |
| 58 Future recordOn() async { | 60 Future recordOn() async { |
| 59 return app.vm.invokeRpc('_setVMTimelineFlags', { | 61 return app.vm.invokeRpc('_setVMTimelineFlags', { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 81 final top = e.offset.top; | 83 final top = e.offset.top; |
| 82 final bottomMargin = 32; | 84 final bottomMargin = 32; |
| 83 final mainHeight = totalHeight - top - bottomMargin; | 85 final mainHeight = totalHeight - top - bottomMargin; |
| 84 e.style.setProperty('height', '${mainHeight}px'); | 86 e.style.setProperty('height', '${mainHeight}px'); |
| 85 e.style.setProperty('width', '100%'); | 87 e.style.setProperty('width', '100%'); |
| 86 } | 88 } |
| 87 | 89 |
| 88 | 90 |
| 89 StreamSubscription _resizeSubscription; | 91 StreamSubscription _resizeSubscription; |
| 90 } | 92 } |
| OLD | NEW |