| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
| 9 import 'package:observatory/src/elements/helpers/tag.dart'; | 9 import 'package:observatory/src/elements/helpers/tag.dart'; |
| 10 import 'package:observatory/src/elements/helpers/uris.dart'; | |
| 11 import 'package:observatory/utils.dart'; | 10 import 'package:observatory/utils.dart'; |
| 12 | 11 |
| 13 class SampleBufferControlChangedElement { | 12 class SampleBufferControlChangedElement { |
| 14 final SampleBufferControlElement element; | 13 final SampleBufferControlElement element; |
| 15 SampleBufferControlChangedElement(this.element); | 14 SampleBufferControlChangedElement(this.element); |
| 16 } | 15 } |
| 17 | 16 |
| 18 class SampleBufferControlElement extends HtmlElement implements Renderable { | 17 class SampleBufferControlElement extends HtmlElement implements Renderable { |
| 19 static const tag = | 18 static const tag = |
| 20 const Tag<SampleBufferControlElement>('sample-buffer-control'); | 19 const Tag<SampleBufferControlElement>('sample-buffer-control'); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 47 set showTag(bool value) => _showTag = _r.checkAndReact(_showTag, value); | 46 set showTag(bool value) => _showTag = _r.checkAndReact(_showTag, value); |
| 48 set profileVM(bool value) => _profileVM = _r.checkAndReact(_profileVM, value); | 47 set profileVM(bool value) => _profileVM = _r.checkAndReact(_profileVM, value); |
| 49 | 48 |
| 50 factory SampleBufferControlElement( | 49 factory SampleBufferControlElement( |
| 51 M.VM vm, | 50 M.VM vm, |
| 52 M.SampleProfileLoadingProgress progress, | 51 M.SampleProfileLoadingProgress progress, |
| 53 Stream<M.SampleProfileLoadingProgressEvent> progressStream, | 52 Stream<M.SampleProfileLoadingProgressEvent> progressStream, |
| 54 {M.SampleProfileTag selectedTag: M.SampleProfileTag.none, | 53 {M.SampleProfileTag selectedTag: M.SampleProfileTag.none, |
| 55 bool showTag: true, | 54 bool showTag: true, |
| 56 RenderingQueue queue}) { | 55 RenderingQueue queue}) { |
| 57 assert(vm != null); | |
| 58 assert(progress != null); | 56 assert(progress != null); |
| 59 assert(progressStream != null); | 57 assert(progressStream != null); |
| 60 assert(selectedTag != null); | 58 assert(selectedTag != null); |
| 61 assert(showTag != null); | 59 assert(showTag != null); |
| 62 SampleBufferControlElement e = document.createElement(tag.name); | 60 SampleBufferControlElement e = document.createElement(tag.name); |
| 63 e._r = new RenderingScheduler(e, queue: queue); | 61 e._r = new RenderingScheduler(e, queue: queue); |
| 64 e._vm = vm; | 62 e._vm = vm; |
| 65 e._progress = progress; | 63 e._progress = progress; |
| 66 e._progressStream = progressStream; | 64 e._progressStream = progressStream; |
| 67 e._tag = selectedTag; | 65 e._tag = selectedTag; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 260 } |
| 263 | 261 |
| 264 void _enableProfiler() { | 262 void _enableProfiler() { |
| 265 _vm.enableProfiler().then((_) { | 263 _vm.enableProfiler().then((_) { |
| 266 _triggerModeChange(_toEvent(null)); | 264 _triggerModeChange(_toEvent(null)); |
| 267 }); | 265 }); |
| 268 } | 266 } |
| 269 | 267 |
| 270 void _triggerModeChange(e) => _onTagChange.add(e); | 268 void _triggerModeChange(e) => _onTagChange.add(e); |
| 271 } | 269 } |
| OLD | NEW |