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 vm_connect_element; | 5 library vm_connect_element; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
9 import 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
10 import 'package:observatory/app.dart'; | 10 import 'package:observatory/app.dart'; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 @published String chromiumAddress = 'localhost:9222'; | 61 @published String chromiumAddress = 'localhost:9222'; |
62 @observable ObservableList<WebSocketVMTarget> chromeTargets = | 62 @observable ObservableList<WebSocketVMTarget> chromeTargets = |
63 new ObservableList<WebSocketVMTarget>(); | 63 new ObservableList<WebSocketVMTarget>(); |
64 | 64 |
65 VMConnectElement.created() : super.created() { | 65 VMConnectElement.created() : super.created() { |
66 pollPeriod = new Duration(seconds: 1); | 66 pollPeriod = new Duration(seconds: 1); |
67 } | 67 } |
68 | 68 |
69 void _connect(WebSocketVMTarget target) { | 69 void _connect(WebSocketVMTarget target) { |
70 _connectToVM(app, target); | 70 _connectToVM(app, target); |
71 app.locationManager.go('#/vm'); | 71 app.locationManager.goForwardingParameters('/vm'); |
72 } | 72 } |
73 | 73 |
74 void onPoll() { | 74 void onPoll() { |
75 _refreshTabs(); | 75 _refreshTabs(); |
76 } | 76 } |
77 | 77 |
78 String _normalizeStandaloneAddress(String networkAddress) { | 78 String _normalizeStandaloneAddress(String networkAddress) { |
79 if (networkAddress.startsWith('ws://')) { | 79 if (networkAddress.startsWith('ws://')) { |
80 return networkAddress; | 80 return networkAddress; |
81 } | 81 } |
(...skipping 26 matching lines...) Expand all Loading... |
108 // This happens when a tab has devtools open! | 108 // This happens when a tab has devtools open! |
109 continue; | 109 continue; |
110 } | 110 } |
111 chromeTargets.add(targets[i]); | 111 chromeTargets.add(targets[i]); |
112 } | 112 } |
113 }).catchError((e) { | 113 }).catchError((e) { |
114 chromeTargets.clear(); | 114 chromeTargets.clear(); |
115 }); | 115 }); |
116 } | 116 } |
117 } | 117 } |
OLD | NEW |