| 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 [Pane] controls the user interface of Observatory. At any given time | 7 /// A [Pane] controls the user interface of Observatory. At any given time |
| 8 /// one pane will be the current pane. Panes are registered at startup. | 8 /// one pane will be the current pane. Panes are registered at startup. |
| 9 /// When the user navigates within the application, each pane is asked if it | 9 /// When the user navigates within the application, each pane is asked if it |
| 10 /// can handle the current location, the first pane to say yes, wins. | 10 /// can handle the current location, the first pane to say yes, wins. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void onInstall() { | 40 void onInstall() { |
| 41 if (element == null) { | 41 if (element == null) { |
| 42 /// Lazily create pane. | 42 /// Lazily create pane. |
| 43 element = new Element.tag('service-view'); | 43 element = new Element.tag('service-view'); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 void visit(String url) { | 47 void visit(String url) { |
| 48 assert(element != null); | 48 assert(element != null); |
| 49 assert(canVisit(url)); | 49 assert(canVisit(url)); |
| 50 if (url == '') { |
| 51 // Nothing requested. |
| 52 return; |
| 53 } |
| 50 /// Request url from VM and display it. | 54 /// Request url from VM and display it. |
| 51 app.vm.get(url).then((obj) { | 55 app.vm.get(url).then((obj) { |
| 52 ServiceObjectViewElement pane = element; | 56 ServiceObjectViewElement pane = element; |
| 53 pane.object = obj; | 57 pane.object = obj; |
| 54 }); | 58 }); |
| 55 } | 59 } |
| 56 | 60 |
| 57 /// Catch all. | 61 /// Catch all. |
| 58 bool canVisit(String url) => true; | 62 bool canVisit(String url) => true; |
| 59 } | 63 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 201 } |
| 198 | 202 |
| 199 ObservatoryApplication(this.rootElement) : | 203 ObservatoryApplication(this.rootElement) : |
| 200 locationManager = new HashLocationManager(), | 204 locationManager = new HashLocationManager(), |
| 201 vm = new HttpVM() { | 205 vm = new HttpVM() { |
| 202 _initOnce(); | 206 _initOnce(); |
| 203 } | 207 } |
| 204 } | 208 } |
| 205 | 209 |
| 206 LocationManager location; | 210 LocationManager location; |
| OLD | NEW |