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

Side by Side Diff: samples-dev/swarm/swarm_ui_lib/base/Env.dart

Issue 2828603002: Format samples and samples-dev directories. (Closed)
Patch Set: Created 3 years, 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of base; 5 part of base;
6 6
7 /** 7 /**
8 * This class has static fields that hold objects that this isolate 8 * This class has static fields that hold objects that this isolate
9 * uses to interact with the environment. Which objects are available 9 * uses to interact with the environment. Which objects are available
10 * depend on how the isolate was started. In the UI isolate 10 * depend on how the isolate was started. In the UI isolate
11 * of the browser, the window object is available. 11 * of the browser, the window object is available.
12 */ 12 */
13 class Env { 13 class Env {
14 static AnimationScheduler _animationScheduler; 14 static AnimationScheduler _animationScheduler;
15 15
16 /** 16 /**
17 * Provides functionality similar to [:window.requestAnimationFrame:] for 17 * Provides functionality similar to [:window.requestAnimationFrame:] for
18 * all platforms. [callback] is executed on the next animation frame that 18 * all platforms. [callback] is executed on the next animation frame that
19 * occurs at or after [minTime]. If [minTime] is not specified, the first 19 * occurs at or after [minTime]. If [minTime] is not specified, the first
20 * available animation frame is used. Returns an id that can be used to 20 * available animation frame is used. Returns an id that can be used to
21 * cancel the pending callback. 21 * cancel the pending callback.
22 */ 22 */
23 static int requestAnimationFrame(AnimationCallback callback, 23 static int requestAnimationFrame(AnimationCallback callback,
24 [Element element = null, 24 [Element element = null, num minTime = null]) {
25 num minTime = null]) {
26 if (_animationScheduler == null) { 25 if (_animationScheduler == null) {
27 _animationScheduler = new AnimationScheduler(); 26 _animationScheduler = new AnimationScheduler();
28 } 27 }
29 return _animationScheduler.requestAnimationFrame( 28 return _animationScheduler.requestAnimationFrame(
30 callback, element, minTime); 29 callback, element, minTime);
31 } 30 }
32 31
33 /** 32 /**
34 * Cancel the pending callback callback matching the specified [id]. 33 * Cancel the pending callback callback matching the specified [id].
35 */ 34 */
36 static void cancelRequestAnimationFrame(int id) { 35 static void cancelRequestAnimationFrame(int id) {
37 _animationScheduler.cancelRequestAnimationFrame(id); 36 _animationScheduler.cancelRequestAnimationFrame(id);
38 } 37 }
39 } 38 }
40 39
41 typedef void XMLHttpRequestCompleted(HttpRequest req); 40 typedef void XMLHttpRequestCompleted(HttpRequest req);
OLDNEW
« no previous file with comments | « samples-dev/swarm/swarm_ui_lib/base/DomWrapper.dart ('k') | samples-dev/swarm/swarm_ui_lib/base/Size.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698