Hide X11 dependencies when use_x11=0.
[chromium-blink-merge.git] / ui / compositor / scoped_animation_duration_scale_mode.h
bloba0ac5d32bcca52588498fec3e836bf937a627d13
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H_
6 #define UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H_
8 #include "base/basictypes.h"
9 #include "ui/compositor/compositor_export.h"
11 namespace ui {
13 // Speed up or slow down animations for testing or debugging.
14 class COMPOSITOR_EXPORT ScopedAnimationDurationScaleMode {
15 public:
16 enum DurationScaleMode {
17 NORMAL_DURATION,
18 FAST_DURATION,
19 SLOW_DURATION,
20 ZERO_DURATION
23 explicit ScopedAnimationDurationScaleMode(
24 DurationScaleMode scoped_duration_scale_mode)
25 : old_duration_scale_mode_(duration_scale_mode_) {
26 duration_scale_mode_ = scoped_duration_scale_mode;
29 ~ScopedAnimationDurationScaleMode() {
30 duration_scale_mode_ = old_duration_scale_mode_;
33 static DurationScaleMode duration_scale_mode() {
34 return duration_scale_mode_;
37 private:
38 DurationScaleMode old_duration_scale_mode_;
40 static DurationScaleMode duration_scale_mode_;
42 DISALLOW_COPY_AND_ASSIGN(ScopedAnimationDurationScaleMode);
45 } // namespace ui
47 #endif // UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H