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

Side by Side Diff: runtime/observatory/lib/src/elements/nav_bar.dart

Issue 2159273003: Converted Observatory top-nav-menu element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Adding _getBoolAttribute helper method Created 4 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 unified diff | Download patch
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 library nav_bar_element; 5 library nav_bar_element;
6 6
7 import 'dart:html' hide Notification; 7 import 'dart:html' hide Notification;
8 import 'observatory_element.dart'; 8 import 'observatory_element.dart';
9 import 'package:observatory/service.dart'; 9 import 'package:observatory/service.dart';
10 import 'package:observatory/app.dart' show Notification; 10 import 'package:observatory/app.dart' show Notification;
11 import 'package:polymer/polymer.dart'; 11 import 'package:polymer/polymer.dart';
12 12
13 13
14 @CustomTag('nav-bar') 14 @CustomTag('nav-bar')
15 class NavBarElement extends ObservatoryElement { 15 class NavBarElement extends ObservatoryElement {
16 @published bool notifyOnPause = true; 16 @published bool notifyOnPause = true;
17 @published bool pad = true; 17 @published bool pad = true;
18 18
19 // Desired nav var height in pixels. 19 // Desired nav var height in pixels.
20 static const height = 40; 20 static const height = 40;
21 21
22 NavBarElement.created() : super.created(); 22 NavBarElement.created() : super.created();
23 } 23 }
24 24
25 @CustomTag('top-nav-menu')
26 class TopNavMenuElement extends ObservatoryElement {
27 @published bool last = false;
28
29 TopNavMenuElement.created() : super.created();
30 }
31
32 @CustomTag('vm-nav-menu') 25 @CustomTag('vm-nav-menu')
33 class VMNavMenuElement extends ObservatoryElement { 26 class VMNavMenuElement extends ObservatoryElement {
34 @published bool last = false; 27 @published bool last = false;
35 @published VM vm; 28 @published VM vm;
36 29
37 String nameAndAddress(name, target) { 30 String nameAndAddress(name, target) {
38 if (name != null && target != null) { 31 if (name != null && target != null) {
39 return '${name}@${target.networkAddress}'; 32 return '${name}@${target.networkAddress}';
40 } else { 33 } else {
41 return '<initializing>'; 34 return '<initializing>';
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 @observable get isUnexpectedError { 103 @observable get isUnexpectedError {
111 return (exception is! NetworkRpcException); 104 return (exception is! NetworkRpcException);
112 } 105 }
113 106
114 void closeItem(MouseEvent e, var detail, Element target) { 107 void closeItem(MouseEvent e, var detail, Element target) {
115 notifications.remove(notification); 108 notifications.remove(notification);
116 } 109 }
117 110
118 NavNotifyExceptionElement.created() : super.created(); 111 NavNotifyExceptionElement.created() : super.created();
119 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698