OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library isolate_reconnect_element; | 5 library isolate_reconnect_element; |
6 | 6 |
7 import 'dart:html'; | |
8 import 'package:polymer/polymer.dart'; | 7 import 'package:polymer/polymer.dart'; |
9 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
10 import 'package:observatory/app.dart'; | |
11 import 'package:observatory/service_html.dart'; | |
12 | 9 |
13 @CustomTag('isolate-reconnect') | 10 @CustomTag('isolate-reconnect') |
14 class IsolateReconnectElement extends ObservatoryElement { | 11 class IsolateReconnectElement extends ObservatoryElement { |
15 IsolateReconnectElement.created() : super.created(); | 12 IsolateReconnectElement.created() : super.created(); |
16 | 13 |
17 get missingIsolateId { | 14 get missingIsolateId { |
18 return app.locationManager.uri.queryParameters['originalIsolateId']; | 15 return app.locationManager.uri.queryParameters['originalIsolateId']; |
19 } | 16 } |
20 | 17 |
21 linkToContinueIn(isolate) { | 18 linkToContinueIn(isolate) { |
22 var parameters = new Map.from(app.locationManager.uri.queryParameters); | 19 var parameters = new Map.from(app.locationManager.uri.queryParameters); |
23 parameters['isolateId'] = isolate.id; | 20 parameters['isolateId'] = isolate.id; |
24 parameters.remove('originalIsolateId'); | 21 parameters.remove('originalIsolateId'); |
25 var path = parameters.remove('originalPath'); | 22 var path = parameters.remove('originalPath'); |
26 path = "/$path"; | 23 path = "/$path"; |
27 var generatedUri = new Uri(path: path, queryParameters: parameters); | 24 var generatedUri = new Uri(path: path, queryParameters: parameters); |
28 return app.locationManager.makeLink(generatedUri.toString()); | 25 return app.locationManager.makeLink(generatedUri.toString()); |
29 } | 26 } |
30 } | 27 } |
OLD | NEW |