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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/elements/action_link.dart

Issue 303673009: Create a ServiceObject for a socket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 action_link_element; 5 library action_link_element;
6 6
7 import 'package:observatory/service.dart';
8 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
9 8
10 @CustomTag('action-link') 9 @CustomTag('action-link')
11 class ActionLinkElement extends PolymerElement { 10 class ActionLinkElement extends PolymerElement {
12 ActionLinkElement.created() : super.created(); 11 ActionLinkElement.created() : super.created();
13 12
14 @observable bool busy = false; 13 @observable bool busy = false;
15 @published var callback = null; 14 @published var callback = null;
16 @published String label = 'action'; 15 @published String label = 'action';
17 16
18 void doAction(var a, var b, var c) { 17 void doAction(var a, var b, var c) {
19 if (busy) { 18 if (busy) {
20 return; 19 return;
21 } 20 }
22 if (callback != null) { 21 if (callback != null) {
23 busy = true; 22 busy = true;
24 // TODO(turnidge): Track down why adding a dummy argument makes 23 // TODO(turnidge): Track down why adding a dummy argument makes
25 // this work but having a no-argument callback doesn't. 24 // this work but having a no-argument callback doesn't.
26 callback(null).whenComplete(() { 25 callback(null).whenComplete(() {
27 busy = false; 26 busy = false;
28 }); 27 });
29 } 28 }
30 } 29 }
31 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698