Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 instance_view_element; | 5 library instance_view_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 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:polymer/polymer.dart'; | 10 import 'package:polymer/polymer.dart'; |
| 11 | 11 |
| 12 @CustomTag('instance-view') | 12 @CustomTag('instance-view') |
| 13 class InstanceViewElement extends ObservatoryElement { | 13 class InstanceViewElement extends ObservatoryElement { |
| 14 @published Instance instance; | 14 @published Instance instance; |
| 15 | 15 |
| 16 InstanceViewElement.created() : super.created(); | 16 InstanceViewElement.created() : super.created(); |
| 17 | 17 |
| 18 instanceChanged(oldValue) { | |
| 19 if (instance != null) { | |
| 20 // We load typeClass and typeArguments because we want to display this inf o. | |
|
Cutch
2016/03/17 18:20:14
line length
turnidge
2016/03/17 18:33:06
Done.
| |
| 21 if (instance.typeClass != null) { | |
| 22 instance.typeClass.load(); | |
| 23 } | |
| 24 if (instance.typeArguments != null) { | |
| 25 instance.typeArguments.load(); | |
| 26 } | |
| 27 } | |
| 28 } | |
| 29 | |
| 18 Future<ServiceObject> evaluate(String expression) { | 30 Future<ServiceObject> evaluate(String expression) { |
| 19 return instance.evaluate(expression); | 31 return instance.evaluate(expression); |
| 20 } | 32 } |
| 21 | 33 |
| 22 Future setBreakOnActivation() { | 34 Future setBreakOnActivation() { |
| 23 return instance.isolate.addBreakOnActivation(instance) | 35 return instance.isolate.addBreakOnActivation(instance) |
| 24 .then((_) => refresh()); | 36 .then((_) => refresh()); |
| 25 } | 37 } |
| 26 | 38 |
| 27 Future clearBreakOnActivation() { | 39 Future clearBreakOnActivation() { |
| 28 return instance.isolate.removeBreakpoint(instance.activationBreakpoint) | 40 return instance.isolate.removeBreakpoint(instance.activationBreakpoint) |
| 29 .then((_) => refresh()); | 41 .then((_) => refresh()); |
| 30 } | 42 } |
| 31 | 43 |
| 32 Future refresh() { | 44 Future refresh() { |
| 33 return instance.reload(); | 45 return instance.reload(); |
| 34 } | 46 } |
| 35 } | 47 } |
| OLD | NEW |