summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/animation/animation_linux.cc
blob: 0bcce53e57f33dc82cb6791f5b8713b3a84b45e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/gfx/animation/animation.h"

#include "ui/gfx/animation/animation_settings_provider_linux.h"

namespace gfx {

namespace {

// GTK only has a global setting for whether animations should be enabled.  So
// use it for all of the specific settings that Chrome needs.
bool AnimationsEnabled() {
  auto* provider = AnimationSettingsProviderLinux::GetInstance();
  return !provider || provider->AnimationsEnabled();
}

}  // namespace

// static
bool Animation::ShouldRenderRichAnimationImpl() {
  return AnimationsEnabled();
}

// static
bool Animation::ScrollAnimationsEnabledBySystem() {
  return AnimationsEnabled();
}

// static
void Animation::UpdatePrefersReducedMotion() {
  prefers_reduced_motion_ = !AnimationsEnabled();
}

}  // namespace gfx