Chromium Code Reviews| Index: runtime/bin/vmservice/client/lib/src/observatory_elements/service_ref.dart |
| diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/service_ref.dart b/runtime/bin/vmservice/client/lib/src/observatory_elements/service_ref.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9ab08f9efe4a730ac19b8d0daf295d18a5c743a3 |
| --- /dev/null |
| +++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/service_ref.dart |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library service_ref_element; |
| + |
| +import 'package:polymer/polymer.dart'; |
| +import 'observatory_element.dart'; |
| + |
| +@CustomTag('service-ref') |
| +class ServiceRefElement extends ObservatoryElement { |
| + @published Map ref; |
| + @published bool internal = false; |
| + ServiceRefElement.created() : super.created(); |
| + |
| + void refChanged(oldValue) { |
| + 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.
|
| + notifyPropertyChange(#url, "", url); |
| + notifyPropertyChange(#name, [], name); |
| + } |
| + |
| + String get url { |
| + if ((app != null) && (ref != null)) { |
| + return app.locationManager.currentIsolateRelativeLink(ref['id']); |
| + } |
| + return ''; |
| + } |
| + |
| + String get name { |
| + if (ref == null) { |
| + return ''; |
| + } |
| + String name_key = internal ? 'name' : 'user_name'; |
| + if (ref[name_key] != null) { |
| + return ref[name_key]; |
| + } |
| + return ''; |
| + } |
| +} |