[go: nahoru, domu]

blob: 03fbd997fedb09fcd4f6e249feac09103debf157 [file] [log] [blame]
Avi Drissman3a215d1e2022-09-07 19:43:091// Copyright 2018 The Chromium Authors
Xiaoqian Daic1544b32018-10-17 21:12:232// 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 Yamaneff3a7ae2020-09-14 21:35:018#include "ash/ash_export.h"
Xiaoqian Daic1544b32018-10-17 21:12:239
10namespace aura {
11class Window;
12}
13
14namespace 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 Yamaneff3a7ae2020-09-14 21:35:0119class ASH_EXPORT ScopedAnimationDisabler {
Xiaoqian Daic1544b32018-10-17 21:12:2320 public:
21 explicit ScopedAnimationDisabler(aura::Window* window);
Nick Diego Yamaneff3a7ae2020-09-14 21:35:0122 ScopedAnimationDisabler(const ScopedAnimationDisabler&) = delete;
23 ScopedAnimationDisabler& operator=(const ScopedAnimationDisabler&) = delete;
Xiaoqian Daic1544b32018-10-17 21:12:2324 ~ScopedAnimationDisabler();
25
26 private:
Nick Diego Yamaneff3a7ae2020-09-14 21:35:0127 aura::Window* const window_;
Xiaoqian Daic1544b32018-10-17 21:12:2328 bool needs_disable_ = false;
Xiaoqian Daic1544b32018-10-17 21:12:2329};
30
31} // namespace ash
32
33#endif // ASH_SCOPED_ANIMATION_DISABLER_H_