| 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 part of app; | 5 part of app; |
| 6 | 6 |
| 7 /// A request response interceptor is called for each response. | 7 /// A request response interceptor is called for each response. |
| 8 typedef void RequestResponseInterceptor(); | 8 typedef void RequestResponseInterceptor(); |
| 9 | 9 |
| 10 /// The observatory application. Instances of this are created and owned | 10 /// The observatory application. Instances of this are created and owned |
| 11 /// by the observatory_application custom element. | 11 /// by the observatory_application custom element. |
| 12 class ObservatoryApplication extends Observable { | 12 class ObservatoryApplication extends Observable { |
| 13 @observable final LocationManager locationManager; | 13 @observable final LocationManager locationManager; |
| 14 @observable final VM vm; | 14 @observable final VM vm; |
| 15 @observable Isolate isolate; | 15 @observable Isolate isolate; |
| 16 |
| 17 /// The current [ServiceObject] being viewed by the application. |
| 16 @observable ServiceObject response; | 18 @observable ServiceObject response; |
| 17 | 19 |
| 18 void setResponse(ServiceObject response) { | 20 /// Any client-level arguments for viewing the current response. |
| 19 this.response = response; | 21 @observable String args; |
| 20 } | 22 // TODO(turnidge): Make args a Map. |
| 21 | 23 |
| 22 void _initOnce() { | 24 void _initOnce() { |
| 23 // Only called once. | 25 // Only called once. |
| 24 assert(locationManager._app == null); | 26 assert(locationManager._app == null); |
| 25 locationManager._app = this; | 27 locationManager._app = this; |
| 26 locationManager.init(); | 28 locationManager.init(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 ObservatoryApplication.devtools() : | 31 ObservatoryApplication.devtools() : |
| 30 locationManager = new LocationManager(), | 32 locationManager = new LocationManager(), |
| 31 vm = new DartiumVM() { | 33 vm = new DartiumVM() { |
| 32 _initOnce(); | 34 _initOnce(); |
| 33 } | 35 } |
| 34 | 36 |
| 35 ObservatoryApplication() : | 37 ObservatoryApplication() : |
| 36 locationManager = new LocationManager(), | 38 locationManager = new LocationManager(), |
| 37 vm = new HttpVM('http://127.0.0.1:8181/') { | 39 vm = new HttpVM('http://127.0.0.1:8181/') { |
| 38 _initOnce(); | 40 _initOnce(); |
| 39 } | 41 } |
| 40 } | 42 } |
| OLD | NEW |