Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library service_ref_element; | |
| 6 | |
| 7 import 'package:polymer/polymer.dart'; | |
| 8 import 'observatory_element.dart'; | |
| 9 | |
| 10 @CustomTag('service-ref') | |
| 11 class ServiceRefElement extends ObservatoryElement { | |
| 12 @published Map ref; | |
| 13 @published bool internal = false; | |
| 14 ServiceRefElement.created() : super.created(); | |
| 15 | |
| 16 void refChanged(oldValue) { | |
| 17 print('service ref changed $ref'); | |
|
turnidge
2013/12/19 20:39:29
There are a variety of these debugging prints in t
Cutch
2013/12/19 21:53:58
Removed.
| |
| 18 notifyPropertyChange(#url, "", url); | |
| 19 notifyPropertyChange(#name, [], name); | |
| 20 } | |
| 21 | |
| 22 String get url { | |
| 23 if ((app != null) && (ref != null)) { | |
| 24 return app.locationManager.currentIsolateRelativeLink(ref['id']); | |
| 25 } | |
| 26 return ''; | |
| 27 } | |
| 28 | |
| 29 String get name { | |
| 30 if (ref == null) { | |
| 31 return ''; | |
| 32 } | |
| 33 String name_key = internal ? 'name' : 'user_name'; | |
| 34 if (ref[name_key] != null) { | |
| 35 return ref[name_key]; | |
| 36 } | |
| 37 return ''; | |
| 38 } | |
| 39 } | |
| OLD | NEW |