| 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 /// The observatory application. Instances of this are created and owned | 7 /// The observatory application. Instances of this are created and owned |
| 8 /// by the observatory_application custom element. | 8 /// by the observatory_application custom element. |
| 9 class ObservatoryApplication { | 9 class ObservatoryApplication { |
| 10 static ObservatoryApplication app; | 10 static ObservatoryApplication app; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 _switchVM(null); | 239 _switchVM(null); |
| 240 } else { | 240 } else { |
| 241 final bool currentTarget = | 241 final bool currentTarget = |
| 242 (_vm as WebSocketVM)?.target == targets.current; | 242 (_vm as WebSocketVM)?.target == targets.current; |
| 243 final bool currentTargetConnected = (_vm != null) && _vm.isConnected; | 243 final bool currentTargetConnected = (_vm != null) && _vm.isConnected; |
| 244 if (!currentTarget || !currentTargetConnected) { | 244 if (!currentTarget || !currentTargetConnected) { |
| 245 _switchVM(new WebSocketVM(targets.current)); | 245 _switchVM(new WebSocketVM(targets.current)); |
| 246 _vm.onConnect.then((_) { | 246 _vm.onConnect.then((_) { |
| 247 app.locationManager.go(Uris.vm()); | 247 app.locationManager.go(Uris.vm()); |
| 248 }); | 248 }); |
| 249 _vm.load(); |
| 249 } else if (currentTargetConnected) { | 250 } else if (currentTargetConnected) { |
| 250 app.locationManager.go(Uris.vm()); | 251 app.locationManager.go(Uris.vm()); |
| 251 } | 252 } |
| 252 } | 253 } |
| 253 }); | 254 }); |
| 254 | 255 |
| 255 Logger.root.info('Setting initial target to ${targets.current.name}'); | 256 Logger.root.info('Setting initial target to ${targets.current.name}'); |
| 256 _switchVM(new WebSocketVM(targets.current)); | 257 _switchVM(new WebSocketVM(targets.current)); |
| 257 _initOnce(); | 258 _initOnce(); |
| 258 | 259 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 289 } | 290 } |
| 290 | 291 |
| 291 // TODO(turnidge): Report this failure via analytics. | 292 // TODO(turnidge): Report this failure via analytics. |
| 292 Logger.root.warning('Caught exception: ${e}\n${st}'); | 293 Logger.root.warning('Caught exception: ${e}\n${st}'); |
| 293 notifications.add(new ExceptionNotification(e, stacktrace: st)); | 294 notifications.add(new ExceptionNotification(e, stacktrace: st)); |
| 294 } | 295 } |
| 295 | 296 |
| 296 // This map keeps track of which curly-blocks have been expanded by the user. | 297 // This map keeps track of which curly-blocks have been expanded by the user. |
| 297 Map<String, bool> expansions = {}; | 298 Map<String, bool> expansions = {}; |
| 298 } | 299 } |
| OLD | NEW |