Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: runtime/bin/vmservice/observatory/lib/src/app/location_manager.dart

Issue 608593005: Fix handling of VM reconnect (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/observatory/lib/src/app/application.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 abstract class LocationManager extends Observable { 7 abstract class LocationManager extends Observable {
8 final _initialPath = '/vm'; 8 final _initialPath = '/vm';
9 ObservatoryApplication _app; 9 ObservatoryApplication _app;
10 10
(...skipping 14 matching lines...) Expand all
25 void _pushUrl(String url) { 25 void _pushUrl(String url) {
26 if (_lastUrl != url) { 26 if (_lastUrl != url) {
27 Logger.root.info('Navigated to ${url}'); 27 Logger.root.info('Navigated to ${url}');
28 window.history.pushState(url, document.title, url); 28 window.history.pushState(url, document.title, url);
29 _lastUrl = url; 29 _lastUrl = url;
30 } 30 }
31 } 31 }
32 32
33 /// Go to a specific url. 33 /// Go to a specific url.
34 void go(String url) { 34 void go(String url) {
35 if (_app.vm == null) { 35 if ((url != makeLink('/vm-connect/')) && _app.vm == null) {
36 if (!window.confirm('Connection with VM has been lost. ' 36 if (!window.confirm('Connection with VM has been lost. '
37 'Proceeding will lose current page.')) { 37 'Proceeding will lose current page.')) {
38 return; 38 return;
39 } 39 }
40 url = makeLink('/vm-connect/'); 40 url = makeLink('/vm-connect/');
41 } 41 }
42 _pushUrl(url); 42 _pushUrl(url);
43 _go(url); 43 _go(url);
44 } 44 }
45 45
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 _go(window.location.pathname); 128 _go(window.location.pathname);
129 } 129 }
130 130
131 void _onLocationChange(PopStateEvent _) { 131 void _onLocationChange(PopStateEvent _) {
132 _go(window.location.pathname); 132 _go(window.location.pathname);
133 } 133 }
134 134
135 /// Given an application url, generate a link for an anchor tag. 135 /// Given an application url, generate a link for an anchor tag.
136 String makeLink(String url) => url; 136 String makeLink(String url) => url;
137 } 137 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/observatory/lib/src/app/application.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698