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

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

Issue 558703005: Do not navigate to vm-connect page upon disconnect (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 15 matching lines...) Expand all
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 (_app.vm == null) {
36 if (!window.confirm('Connection with VM has been lost. '
37 'Proceeding will lose current page.')) {
38 return;
39 }
36 url = makeLink('/vm-connect/'); 40 url = makeLink('/vm-connect/');
turnidge 2014/09/15 16:24:48 Consider adding a notification.
Cutch 2014/09/15 18:11:20 Done. I notify the user immediately on disconnect.
37 } 41 }
38 _pushUrl(url); 42 _pushUrl(url);
39 _go(url); 43 _go(url);
40 } 44 }
41 45
42 void _go(String url) { 46 void _go(String url) {
43 // Chop off leading '#'. 47 // Chop off leading '#'.
44 if (url.startsWith('#')) { 48 if (url.startsWith('#')) {
45 url = url.substring(1); 49 url = url.substring(1);
46 } 50 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 _go(window.location.pathname); 128 _go(window.location.pathname);
125 } 129 }
126 130
127 void _onLocationChange(PopStateEvent _) { 131 void _onLocationChange(PopStateEvent _) {
128 _go(window.location.pathname); 132 _go(window.location.pathname);
129 } 133 }
130 134
131 /// Given an application url, generate a link for an anchor tag. 135 /// Given an application url, generate a link for an anchor tag.
132 String makeLink(String url) => url; 136 String makeLink(String url) => url;
133 } 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