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

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

Issue 378113002: Improve script display in the observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
« no previous file with comments | « runtime/bin/vmservice/client/lib/app.dart ('k') | runtime/bin/vmservice/client/lib/src/app/page.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/client/lib/src/app/application.dart
diff --git a/runtime/bin/vmservice/client/lib/src/app/application.dart b/runtime/bin/vmservice/client/lib/src/app/application.dart
index 6eae10b67797fa92478c08444a616632100e213b..620d82c2a8c1e34af0884e1128d90a457a10a5d1 100644
--- a/runtime/bin/vmservice/client/lib/src/app/application.dart
+++ b/runtime/bin/vmservice/client/lib/src/app/application.dart
@@ -8,8 +8,8 @@ part of app;
/// by the observatory_application custom element.
class ObservatoryApplication extends Observable {
static ObservatoryApplication app;
- final _paneRegistry = new List<Pane>();
- Pane _currentPane;
+ final _pageRegistry = new List<Page>();
+ @observable Page currentPage;
@observable final LocationManager locationManager;
VM _vm;
VM get vm => _vm;
@@ -42,7 +42,7 @@ class ObservatoryApplication extends Observable {
void _initOnce(bool chromium) {
assert(app == null);
app = this;
- _registerPanes();
+ _registerPages();
locationManager._init(this);
}
@@ -91,14 +91,14 @@ class ObservatoryApplication extends Observable {
}
}
- void _registerPanes() {
- // Register ClassTreePane.
- _paneRegistry.add(new ClassTreePane(this));
- _paneRegistry.add(new VMConnectPane(this));
- _paneRegistry.add(new ErrorViewPane(this));
- // Note that ServiceObjectPane must be the last entry in the list as it is
+ void _registerPages() {
+ // Register ClassTreePage.
+ _pageRegistry.add(new ClassTreePage(this));
+ _pageRegistry.add(new VMConnectPage(this));
+ _pageRegistry.add(new ErrorViewPage(this));
+ // Note that ServiceObjectPage must be the last entry in the list as it is
// the catch all.
- _paneRegistry.add(new ServiceObjectPane(this));
+ _pageRegistry.add(new ServiceObjectPage(this));
}
void _onError(ServiceError error) {
@@ -109,7 +109,7 @@ class ObservatoryApplication extends Observable {
void _onException(ServiceException exception) {
lastErrorOrException = exception;
if (exception.kind == 'NetworkException') {
- // Got a network exception, visit the vm-connect pane.
+ // Got a network exception, visit the vm-connect page.
locationManager.go(locationManager.makeLink('/vm-connect/'));
} else {
_visit('error/', null);
@@ -117,41 +117,46 @@ class ObservatoryApplication extends Observable {
}
void _visit(String url, String args) {
- // TODO(johnmccutchan): Pass [args] to pane.
- for (var i = 0; i < _paneRegistry.length; i++) {
- var pane = _paneRegistry[i];
- if (pane.canVisit(url)) {
- _installPane(pane);
- pane.visit(url);
+ var argsMap;
+ if (args == null) {
+ argsMap = {};
+ } else {
+ argsMap = Uri.splitQueryString(args);
+ }
+ for (var i = 0; i < _pageRegistry.length; i++) {
+ var page = _pageRegistry[i];
+ if (page.canVisit(url)) {
+ _installPage(page);
+ page.visit(url, argsMap);
return;
}
}
throw new FallThroughError();
}
- /// Set the Observatory application pane.
- void _installPane(Pane pane) {
- assert(pane != null);
- if (_currentPane == pane) {
+ /// Set the Observatory application page.
+ void _installPage(Page page) {
+ assert(page != null);
+ if (currentPage == page) {
// Already isntalled.
return;
}
- if (_currentPane != null) {
- Logger.root.info('Uninstalling pane: $_currentPane');
- _currentPane.onUninstall();
+ if (currentPage != null) {
+ Logger.root.info('Uninstalling page: $currentPage');
+ currentPage.onUninstall();
// Clear children.
rootElement.children.clear();
}
- Logger.root.info('Installing pane: $pane');
+ Logger.root.info('Installing page: $page');
try {
- pane.onInstall();
+ page.onInstall();
} catch (e) {
- Logger.root.severe('Failed to install pane: $e');
+ Logger.root.severe('Failed to install page: $e');
}
- // Add new pane.
- rootElement.children.add(pane.element);
- // Remember pane.
- _currentPane = pane;
+ // Add new page.
+ rootElement.children.add(page.element);
+ // Remember page.
+ currentPage = page;
}
ObservatoryApplication.devtools(this.rootElement) :
« no previous file with comments | « runtime/bin/vmservice/client/lib/app.dart ('k') | runtime/bin/vmservice/client/lib/src/app/page.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698