Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 1 | // Copyright 2018 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. |
| 4 | |
| 5 | #ifndef ASH_SCOPED_ANIMATION_DISABLER_H_ |
| 6 | #define ASH_SCOPED_ANIMATION_DISABLER_H_ |
| 7 | |
Nick Diego Yamane | ff3a7ae | 2020-09-14 21:35:01 | [diff] [blame^] | 8 | #include "ash/ash_export.h" |
Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 9 | |
| 10 | namespace aura { |
| 11 | class Window; |
| 12 | } |
| 13 | |
| 14 | namespace ash { |
| 15 | |
| 16 | // Helper class to perform window state changes without animations. Used to hide |
| 17 | // /show/minimize windows without having their animation interfere with the ones |
| 18 | // this class is in charge of. |
Nick Diego Yamane | ff3a7ae | 2020-09-14 21:35:01 | [diff] [blame^] | 19 | class ASH_EXPORT ScopedAnimationDisabler { |
Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 20 | public: |
| 21 | explicit ScopedAnimationDisabler(aura::Window* window); |
Nick Diego Yamane | ff3a7ae | 2020-09-14 21:35:01 | [diff] [blame^] | 22 | ScopedAnimationDisabler(const ScopedAnimationDisabler&) = delete; |
| 23 | ScopedAnimationDisabler& operator=(const ScopedAnimationDisabler&) = delete; |
Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 24 | ~ScopedAnimationDisabler(); |
| 25 | |
| 26 | private: |
Nick Diego Yamane | ff3a7ae | 2020-09-14 21:35:01 | [diff] [blame^] | 27 | aura::Window* const window_; |
Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 28 | bool needs_disable_ = false; |
Xiaoqian Dai | c1544b3 | 2018-10-17 21:12:23 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | } // namespace ash |
| 32 | |
| 33 | #endif // ASH_SCOPED_ANIMATION_DISABLER_H_ |