scoped_animation_disabler.h 951 B

123456789101112131415161718192021222324252627282930313233
  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. #ifndef ASH_SCOPED_ANIMATION_DISABLER_H_
  5. #define ASH_SCOPED_ANIMATION_DISABLER_H_
  6. #include "ash/ash_export.h"
  7. namespace aura {
  8. class Window;
  9. }
  10. namespace ash {
  11. // Helper class to perform window state changes without animations. Used to hide
  12. // /show/minimize windows without having their animation interfere with the ones
  13. // this class is in charge of.
  14. class ASH_EXPORT ScopedAnimationDisabler {
  15. public:
  16. explicit ScopedAnimationDisabler(aura::Window* window);
  17. ScopedAnimationDisabler(const ScopedAnimationDisabler&) = delete;
  18. ScopedAnimationDisabler& operator=(const ScopedAnimationDisabler&) = delete;
  19. ~ScopedAnimationDisabler();
  20. private:
  21. aura::Window* const window_;
  22. bool needs_disable_ = false;
  23. };
  24. } // namespace ash
  25. #endif // ASH_SCOPED_ANIMATION_DISABLER_H_