Upload upstream chromium 73.0.3683.0
[platform/framework/web/chromium-efl.git] / ash / scoped_animation_disabler.cc
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 #include "ash/scoped_animation_disabler.h"
6
7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/base/class_property.h"
9
10 namespace ash {
11
12 ScopedAnimationDisabler::ScopedAnimationDisabler(aura::Window* window)
13     : window_(window) {
14   needs_disable_ = !window_->GetProperty(aura::client::kAnimationsDisabledKey);
15   if (needs_disable_)
16     window_->SetProperty(aura::client::kAnimationsDisabledKey, true);
17 }
18
19 ScopedAnimationDisabler::~ScopedAnimationDisabler() {
20   if (needs_disable_)
21     window_->ClearProperty(aura::client::kAnimationsDisabledKey);
22 }
23
24 }  // namespace ash