blob: 4a20b1ac260b844089942f12e7e7c8cfa3c78297 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2021 The Chromium Authors
Allen Baueracb6b7c2021-02-27 01:43:322// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/native_theme/native_theme_utils.h"
6
Helmut Januschka36619c12024-04-24 14:33:197#include <string_view>
8
Zoraiz Naeembadbeda2025-03-03 22:15:039#include "ui/native_theme/features/native_theme_features.h"
Zhengzheng Liu4d68db22024-10-19 04:46:5710
Allen Baueracb6b7c2021-02-27 01:43:3211namespace ui {
12
Helmut Januschka36619c12024-04-24 14:33:1913std::string_view NativeThemeColorSchemeName(
Allen Baueracb6b7c2021-02-27 01:43:3214 NativeTheme::ColorScheme color_scheme) {
15 switch (color_scheme) {
16 case NativeTheme::ColorScheme::kDefault:
17 return "kDefault";
18 case NativeTheme::ColorScheme::kLight:
19 return "kLight";
20 case NativeTheme::ColorScheme::kDark:
21 return "kDark";
22 case NativeTheme::ColorScheme::kPlatformHighContrast:
23 return "kPlatformHighContrast";
24 default:
Peter Boströme4f1aef52024-10-29 23:42:0325 NOTREACHED() << "Invalid NativeTheme::ColorScheme";
Allen Baueracb6b7c2021-02-27 01:43:3226 }
27}
28
Zhengzheng Liu4d68db22024-10-19 04:46:5729bool IsOverlayScrollbarEnabled() {
Zhengzheng Liub140c9962024-11-08 22:21:5230#if BUILDFLAG(IS_CHROMEOS)
31 return NativeTheme::GetInstanceForWeb()->use_overlay_scrollbar();
32#else
33 return IsOverlayScrollbarEnabledByFeatureFlag();
34#endif
Zhengzheng Liu4d68db22024-10-19 04:46:5735}
36
Allen Baueracb6b7c2021-02-27 01:43:3237} // namespace ui