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

Unified Diff: runtime/bin/vmservice/client/lib/src/app/location_manager.dart

Issue 335463008: Allow Observatory to run as a hosted web service (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/app/location_manager.dart
diff --git a/runtime/bin/vmservice/client/lib/src/app/location_manager.dart b/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
index 7cadb37caeed303bb0a94150f6da4cbd47820aaa..eb4d89008bbd255987e71dcf69cd2d2be5e46296 100644
--- a/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
+++ b/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
@@ -22,13 +22,20 @@ abstract class LocationManager extends Observable {
void _onStartup();
void _onLocationChange(PopStateEvent event);
- /// Go to a specific url.
- void go(String url) {
+ void _pushUrl(String url) {
if (_lastUrl != url) {
Logger.root.info('Navigated to ${url}');
window.history.pushState(url, document.title, url);
_lastUrl = url;
}
+ }
+
+ /// Go to a specific url.
+ void go(String url) {
+ if (_app.vm == null) {
+ url = makeLink('/vm-connect/');
+ }
+ _pushUrl(url);
_go(url);
}
@@ -67,13 +74,13 @@ abstract class LocationManager extends Observable {
/// Handle clicking on an application url link.
void onGoto(MouseEvent event, var detail, Element target) {
var href = target.attributes['href'];
- if (event.button > 1 || event.metaKey || event.ctrlKey ||
+ if (event.button > 0 || event.metaKey || event.ctrlKey ||
event.shiftKey || event.altKey) {
// Not a left-click or a left-click with a modifier key:
// Let browser handle.
return;
}
- location.go(href);
+ go(href);
event.preventDefault();
}
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/app/application.dart ('k') | runtime/bin/vmservice/client/lib/src/app/pane.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698