| 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 class Notification { | 7 class Notification { |
| 8 Notification.fromEvent(this.event); | 8 Notification.fromEvent(this.event); |
| 9 Notification.fromException(this.exception, this.stacktrace); | 9 Notification.fromException(this.exception, this.stacktrace); |
| 10 | 10 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 throw new FallThroughError(); | 181 throw new FallThroughError(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 /// Set the Observatory application page. | 184 /// Set the Observatory application page. |
| 185 void _installPage(Page page) { | 185 void _installPage(Page page) { |
| 186 assert(page != null); | 186 assert(page != null); |
| 187 if (currentPage == page) { | 187 if (currentPage == page) { |
| 188 // Already isntalled. | 188 // Already installed. |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 if (currentPage != null) { | 191 if (currentPage != null) { |
| 192 Logger.root.info('Uninstalling page: $currentPage'); | 192 Logger.root.info('Uninstalling page: $currentPage'); |
| 193 currentPage.onUninstall(); | 193 currentPage.onUninstall(); |
| 194 // Clear children. | 194 // Clear children. |
| 195 rootElement.children.clear(); | 195 rootElement.children.clear(); |
| 196 } | 196 } |
| 197 Logger.root.info('Installing page: $page'); | 197 Logger.root.info('Installing page: $page'); |
| 198 try { | 198 try { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 // TODO(turnidge): Report this failure via analytics. | 243 // TODO(turnidge): Report this failure via analytics. |
| 244 Logger.root.warning('Caught exception: ${e}\n${st}'); | 244 Logger.root.warning('Caught exception: ${e}\n${st}'); |
| 245 notifications.add(new Notification.fromException(e, st)); | 245 notifications.add(new Notification.fromException(e, st)); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // This map keeps track of which curly-blocks have been expanded by the user. | 248 // This map keeps track of which curly-blocks have been expanded by the user. |
| 249 Map<String,bool> expansions = {}; | 249 Map<String,bool> expansions = {}; |
| 250 } | 250 } |
| OLD | NEW |