0

Remove the assertion of use_blink from //ui/color.

In crrev.com/c/5051135, the assert was added because when
`//ui/native_theme/features` was unconditionally added to the deps of
//ui/color:mixers, ios build started failing on `use_blink` assert from
other BUILD files down the dependency tree.

To solve this issue, `use_blink` assertion was added `//ui/color` and
this this target was conditionally used.

However, given that `//ui/native_theme/features` simply defines
features, it is not ideal to limit `//ui/color`. This can be solved by
moving define native_theme_feature.* in a separate BUILD file.

This CL also migrated ui/native_theme header files to use
`COMPONENT_EXPORT()`

AX-Relnotes: n/a.
Change-Id: I04e8b7bb60e6204706ffd372b666de49cc5b862a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6244911
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Zoraiz Naeem <zoraiznaeem@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427381}
This commit is contained in:
Zoraiz Naeem
2025-03-03 14:15:03 -08:00
committed by Chromium LUCI CQ
parent c62e2bc3d9
commit badbedab2a
51 changed files with 134 additions and 165 deletions

@ -109,8 +109,8 @@
#include "ui/gfx/animation/animation.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/notifier_id.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/cursor_manager.h"

@ -54,8 +54,8 @@
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/notification.h"
#include "ui/message_center/public/cpp/notification_types.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_features.h"
using message_center::MessageCenter;

@ -250,7 +250,7 @@
#include "ui/gl/buildflags.h"
#include "ui/gl/gl_features.h"
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/ui_features.h"
#include "url/url_features.h"

@ -113,7 +113,7 @@
#include "ui/events/devices/input_device_event_observer.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
#include "ui/gfx/animation/animation.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"

@ -117,7 +117,7 @@
#include "ui/base/clipboard/test/test_clipboard.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "url/gurl.h"
#if defined(TOOLKIT_VIEWS) && !BUILDFLAG(IS_MAC)

@ -47,7 +47,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/events/ash/keyboard_layout_util.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/webui/webui_util.h"
namespace ash::settings {

@ -3,6 +3,6 @@ include_rules = [
"+content/public/renderer",
"+content/public/test",
"+third_party/blink/public",
"+ui/native_theme/native_theme_features.h",
"+ui/native_theme/features/native_theme_features.h",
"+third_party/skia/include/codec",
]

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/paint_preview/renderer/paint_preview_recorder_impl.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
@ -12,6 +10,7 @@
#include "build/build_config.h"
#include "components/paint_preview/common/file_stream.h"
#include "components/paint_preview/common/mojom/paint_preview_recorder.mojom.h"
#include "components/paint_preview/renderer/paint_preview_recorder_impl.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/test/render_view_test.h"
#include "content/public/test/test_utils.h"
@ -25,7 +24,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace paint_preview {

@ -33,7 +33,7 @@
#include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h"
#include "third_party/blink/public/common/switches.h"
#include "ui/base/ui_base_features.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#if BUILDFLAG(IS_MAC)
#include "ui/base/test/scoped_preferred_scroller_style_mac.h"

@ -104,7 +104,7 @@
#include "ui/gfx/color_space.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "url/url_constants.h"
#if BUILDFLAG(IS_WIN)

@ -179,7 +179,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/latency/latency_info.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#if defined(USE_AURA)
#include "content/browser/renderer_host/render_widget_host_view_aura.h"

@ -24,7 +24,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace content {

@ -45,7 +45,7 @@
#include "ui/events/blink/blink_features.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme_utils.h"
#if BUILDFLAG(IS_ANDROID)

@ -24,7 +24,7 @@
#include "ui/accessibility/ax_location_and_scroll_updates.h"
#include "ui/accessibility/ax_tree.h"
#include "ui/accessibility/null_ax_action_target.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace content {

@ -3,6 +3,6 @@ specific_include_rules = {
"+ui/native_theme/scrollbar_animator_mac.h",
],
"scrollbar_theme_fluent_unittest.cc": [
"+ui/native_theme/native_theme_features.h",
"+ui/native_theme/features/native_theme_features.h",
],
}

@ -16,7 +16,7 @@
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace blink {

@ -1756,7 +1756,7 @@ component("platform") {
"//ui/base/cursor",
"//ui/base/mojom:ui_base_types_blink",
"//ui/gfx",
"//ui/native_theme:features",
"//ui/native_theme/features",
]
deps = [
"//base:base_static",

@ -45,7 +45,7 @@ include_rules = [
"+third_party/blink/renderer/platform/weborigin",
"+third_party/blink/renderer/platform/wtf",
"+third_party/blink/renderer/platform/wtf/shared_buffer.h",
"+ui/native_theme/native_theme_features.h",
"+ui/native_theme/features/native_theme_features.h",
]
specific_include_rules = {

@ -14,7 +14,7 @@
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/web/web_heap.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace blink {

@ -14,8 +14,8 @@
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "ui/color/color_provider_utils.h"
#include "ui/gfx/color_palette.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
namespace blink {

@ -21,7 +21,7 @@ specific_include_rules = {
"+media/base/media_switches.h",
"+ui/base/ui_base_features.h",
"+ui/base/ui_base_switches.h",
"+ui/native_theme/native_theme_features.h",
"+ui/native_theme/features/native_theme_features.h",
"+ui/native_theme/native_theme_utils.h",
"+ui/native_theme/overlay_scrollbar_constants_aura.h",
],

@ -30,7 +30,7 @@
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme_utils.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"

@ -486,6 +486,8 @@ component("base") {
"//skia",
"//third_party/abseil-cpp:absl",
"//ui/base/mojom:ui_base_types",
"//ui/color",
"//ui/color:color_headers",
"//ui/gfx",
"//ui/gfx/geometry",
]
@ -544,11 +546,9 @@ component("base") {
if (use_blink) {
deps += [
"//ui/color",
"//ui/events",
"//ui/events/devices",
]
public_deps += [ "//ui/color:color_headers" ]
}
if (is_win) {
@ -1061,6 +1061,7 @@ test("ui_base_unittests") {
"//ui/base/data_transfer_policy:unittests",
"//ui/base/metadata:metadata_tests",
"//ui/base/prediction:prediction",
"//ui/color",
"//ui/display",
"//ui/gfx:test_support",
"//ui/resources",
@ -1131,7 +1132,6 @@ test("ui_base_unittests") {
if (use_blink) {
deps += [
"//ui/color",
"//ui/events:events_base",
"//ui/events:test_support",
]

@ -7,8 +7,6 @@ import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")
import("//ui/base/ui_features.gni")
assert(use_blink, "Not supported without use_blink")
source_set("color_headers") {
sources = [
"color_id.h",
@ -178,7 +176,7 @@ component("mixers") {
"//ui/base:features",
"//ui/color/dynamic_color",
"//ui/gfx:color_utils",
"//ui/native_theme:features",
"//ui/native_theme/features",
]
public_deps = [ "//base" ]

@ -13,7 +13,7 @@
#include "ui/color/ref_color_mixer.h"
#include "ui/color/sys_color_mixer.h"
#include "ui/color/ui_color_mixer.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace ui {

@ -58,6 +58,7 @@ source_set("unit_tests") {
":menus",
"//testing/gmock",
"//testing/gtest",
"//ui/color",
"//ui/gfx",
"//ui/gfx:test_support",
]
@ -69,8 +70,4 @@ source_set("unit_tests") {
"//ui/events:test_support",
]
}
if (use_blink) {
deps += [ "//ui/color" ]
}
}

@ -5,20 +5,6 @@
import("//build/config/ui.gni")
import("//testing/test.gni")
component("features") {
output_name = "native_theme_features"
defines = [ "NATIVE_THEME_IMPLEMENTATION" ]
sources = [
"native_theme_export.h",
"native_theme_features.cc",
"native_theme_features.h",
]
deps = [ "//base" ]
}
component("native_theme") {
sources = [
"caption_style.cc",
@ -80,10 +66,10 @@ component("native_theme") {
]
}
defines = [ "NATIVE_THEME_IMPLEMENTATION" ]
defines = [ "IS_NATIVE_THEME_IMPL" ]
public_deps = [
":features",
"features",
"//skia",
]
@ -105,7 +91,7 @@ component("native_theme") {
if (is_win) {
component("native_theme_browser") {
defines = [ "NATIVE_THEME_IMPLEMENTATION" ]
defines = [ "IS_NATIVE_THEME_IMPL" ]
# These files cannot work in the renderer on Windows.
sources = [

@ -8,13 +8,13 @@
#include <optional>
#include <string>
#include "base/component_export.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkScalar.h"
#include "ui/native_theme/native_theme_export.h"
namespace ui {
struct NATIVE_THEME_EXPORT CaptionStyle {
struct COMPONENT_EXPORT(NATIVE_THEME) CaptionStyle {
CaptionStyle();
CaptionStyle(const CaptionStyle& other);
~CaptionStyle();

@ -5,9 +5,9 @@
#ifndef UI_NATIVE_THEME_COMMON_THEME_H_
#define UI_NATIVE_THEME_COMMON_THEME_H_
#include "base/component_export.h"
#include "ui/color/color_id.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_export.h"
namespace ui {
@ -15,7 +15,7 @@ class ColorProvider;
// Drawing code that is common for all platforms.
void NATIVE_THEME_EXPORT CommonThemePaintMenuItemBackground(
void COMPONENT_EXPORT(NATIVE_THEME) CommonThemePaintMenuItemBackground(
const NativeTheme* theme,
const ColorProvider* color_provider,
cc::PaintCanvas* canvas,

@ -0,0 +1,16 @@
# Copyright 2025 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
component("features") {
output_name = "native_theme_features"
defines = [ "IS_NATIVE_THEME_FEATURES_IMPL" ]
sources = [
"native_theme_features.cc",
"native_theme_features.h",
]
deps = [ "//base" ]
}

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "base/feature_list.h"
#include "build/build_config.h"

@ -0,0 +1,46 @@
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Defines all the command-line switches used by native theme
#ifndef UI_NATIVE_THEME_FEATURES_NATIVE_THEME_FEATURES_H_
#define UI_NATIVE_THEME_FEATURES_NATIVE_THEME_FEATURES_H_
#include "base/component_export.h"
#include "base/feature_list.h"
namespace features {
COMPONENT_EXPORT(NATIVE_THEME_FEATURES) BASE_DECLARE_FEATURE(kOverlayScrollbar);
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
BASE_DECLARE_FEATURE(kScrollbarAnimations);
#if BUILDFLAG(IS_CHROMEOS)
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
BASE_DECLARE_FEATURE(kOverlayScrollbarsOSSetting);
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
bool IsOverlayScrollbarOSSettingEnabled();
#endif
COMPONENT_EXPORT(NATIVE_THEME_FEATURES) BASE_DECLARE_FEATURE(kFluentScrollbar);
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
BASE_DECLARE_FEATURE(kFluentOverlayScrollbar);
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
BASE_DECLARE_FEATURE(kModifyScrollbarCssColorOnHoverOrPress);
} // namespace features
namespace ui {
COMPONENT_EXPORT(NATIVE_THEME_FEATURES) bool IsFluentOverlayScrollbarEnabled();
COMPONENT_EXPORT(NATIVE_THEME_FEATURES) bool IsFluentScrollbarEnabled();
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
bool IsOverlayScrollbarEnabledByFeatureFlag();
COMPONENT_EXPORT(NATIVE_THEME_FEATURES)
bool IsModifyScrollbarCssColorOnHoverOrPressEnabled();
} // namespace ui
#endif // UI_NATIVE_THEME_FEATURES_NATIVE_THEME_FEATURES_H_

@ -22,7 +22,7 @@
#include "ui/color/color_provider_key.h"
#include "ui/color/color_provider_utils.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme_utils.h"
namespace ui {

@ -8,6 +8,7 @@
#include <map>
#include <optional>
#include "base/component_export.h"
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
@ -24,7 +25,6 @@
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/native_theme/caption_style.h"
#include "ui/native_theme/native_theme_export.h"
#include "ui/native_theme/native_theme_observer.h"
namespace cc {
@ -56,7 +56,7 @@ namespace ui {
//
// NativeTheme also supports getting the default size of a given part with
// the GetPartSize() method.
class NATIVE_THEME_EXPORT NativeTheme {
class COMPONENT_EXPORT(NATIVE_THEME) NativeTheme {
public:
// The part to be painted / sized.
enum Part {
@ -237,7 +237,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
kRight,
};
struct NATIVE_THEME_EXPORT MenuListExtraParams {
struct COMPONENT_EXPORT(NATIVE_THEME) MenuListExtraParams {
bool has_border = false;
bool has_border_radius = false;
int arrow_x = 0;
@ -336,7 +336,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
bool right_to_left = false;
};
struct NATIVE_THEME_EXPORT TextFieldExtraParams {
struct COMPONENT_EXPORT(NATIVE_THEME) TextFieldExtraParams {
bool is_text_area = false;
bool is_listbox = false;
SkColor background_color = gfx::kPlaceholderColor;
@ -657,7 +657,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
// web native theme for Windows observes the corresponding ui native theme in
// order to receive changes regarding the state of dark mode, forced colors
// mode, preferred color scheme and preferred contrast.
class NATIVE_THEME_EXPORT ColorSchemeNativeThemeObserver
class COMPONENT_EXPORT(NATIVE_THEME) ColorSchemeNativeThemeObserver
: public NativeThemeObserver {
public:
ColorSchemeNativeThemeObserver(NativeTheme* theme_to_update);

@ -29,7 +29,7 @@
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme_fluent.h"
#include "ui/native_theme/native_theme_utils.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"

@ -5,13 +5,14 @@
#ifndef UI_NATIVE_THEME_NATIVE_THEME_AURA_H_
#define UI_NATIVE_THEME_NATIVE_THEME_AURA_H_
#include "base/component_export.h"
#include "base/no_destructor.h"
#include "ui/native_theme/native_theme_base.h"
namespace ui {
// Aura implementation of native theme support.
class NATIVE_THEME_EXPORT NativeThemeAura : public NativeThemeBase {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeAura : public NativeThemeBase {
protected:
friend class NativeTheme;
friend class NativeThemeAuraTest;

@ -37,8 +37,8 @@
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_features.h"
namespace {

@ -5,6 +5,7 @@
#ifndef UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
#define UI_NATIVE_THEME_NATIVE_THEME_BASE_H_
#include "base/component_export.h"
#include "base/gtest_prod_util.h"
#include "cc/paint/paint_flags.h"
#include "ui/native_theme/native_theme.h"
@ -17,7 +18,7 @@ class Size;
namespace ui {
// Theme support for non-Windows toolkits.
class NATIVE_THEME_EXPORT NativeThemeBase : public NativeTheme {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeBase : public NativeTheme {
public:
NativeThemeBase(const NativeThemeBase&) = delete;
NativeThemeBase& operator=(const NativeThemeBase&) = delete;

@ -7,7 +7,7 @@
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace ui {

@ -1,36 +0,0 @@
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_NATIVE_THEME_NATIVE_THEME_EXPORT_H_
#define UI_NATIVE_THEME_NATIVE_THEME_EXPORT_H_
// Defines NATIVE_THEME_EXPORT so that functionality implemented by the
// native_theme library can be exported to consumers.
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(NATIVE_THEME_IMPLEMENTATION)
#define NATIVE_THEME_EXPORT __declspec(dllexport)
#else
#define NATIVE_THEME_EXPORT __declspec(dllimport)
#endif // defined(NATIVE_THEME_IMPLEMENTATION)
#else // !defined(WIN32)
#if defined(NATIVE_THEME_IMPLEMENTATION)
#define NATIVE_THEME_EXPORT __attribute__((visibility("default")))
#else
#define NATIVE_THEME_EXPORT
#endif
#endif // defined(WIN32)
#else // !defined(COMPONENT_BUILD)
#define NATIVE_THEME_EXPORT
#endif // defined(COMPONENT_BUILD)
#endif // UI_NATIVE_THEME_NATIVE_THEME_EXPORT_H_

@ -1,40 +0,0 @@
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Defines all the command-line switches used by native theme
#ifndef UI_NATIVE_THEME_NATIVE_THEME_FEATURES_H_
#define UI_NATIVE_THEME_NATIVE_THEME_FEATURES_H_
#include "base/feature_list.h"
#include "ui/native_theme/native_theme_export.h"
namespace features {
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(kOverlayScrollbar);
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(kScrollbarAnimations);
#if BUILDFLAG(IS_CHROMEOS)
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(kOverlayScrollbarsOSSetting);
NATIVE_THEME_EXPORT bool IsOverlayScrollbarOSSettingEnabled();
#endif
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(kFluentScrollbar);
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(kFluentOverlayScrollbar);
NATIVE_THEME_EXPORT BASE_DECLARE_FEATURE(
kModifyScrollbarCssColorOnHoverOrPress);
} // namespace features
namespace ui {
NATIVE_THEME_EXPORT bool IsFluentOverlayScrollbarEnabled();
NATIVE_THEME_EXPORT bool IsFluentScrollbarEnabled();
NATIVE_THEME_EXPORT bool IsOverlayScrollbarEnabledByFeatureFlag();
NATIVE_THEME_EXPORT bool IsModifyScrollbarCssColorOnHoverOrPressEnabled();
} // namespace ui
#endif // UI_NATIVE_THEME_NATIVE_THEME_FEATURES_H_

@ -19,8 +19,8 @@
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/native_theme/features/native_theme_features.h"
#include "ui/native_theme/native_theme_constants_fluent.h"
#include "ui/native_theme/native_theme_features.h"
namespace ui {

@ -7,6 +7,7 @@
#include <optional>
#include "base/component_export.h"
#include "ui/native_theme/native_theme_base.h"
namespace gfx {
@ -20,7 +21,8 @@ class SkTypeface;
namespace ui {
class NATIVE_THEME_EXPORT NativeThemeFluent : public NativeThemeBase {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeFluent
: public NativeThemeBase {
public:
explicit NativeThemeFluent(bool should_only_use_dark_colors);

@ -5,18 +5,18 @@
#ifndef UI_NATIVE_THEME_NATIVE_THEME_MAC_H_
#define UI_NATIVE_THEME_NATIVE_THEME_MAC_H_
#include "base/component_export.h"
#include "base/no_destructor.h"
#include "ui/gfx/geometry/size.h"
#include "ui/native_theme/native_theme_aura.h"
#include "ui/native_theme/native_theme_base.h"
#include "ui/native_theme/native_theme_export.h"
@class NativeThemeEffectiveAppearanceObserver;
namespace ui {
// Mac implementation of native theme support.
class NATIVE_THEME_EXPORT NativeThemeMac : public NativeThemeBase {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeMac : public NativeThemeBase {
public:
static const int kButtonCornerRadius = 3;

@ -5,14 +5,14 @@
#ifndef UI_NATIVE_THEME_NATIVE_THEME_OBSERVER_H_
#define UI_NATIVE_THEME_NATIVE_THEME_OBSERVER_H_
#include "ui/native_theme/native_theme_export.h"
#include "base/component_export.h"
namespace ui {
class NativeTheme;
// Observers which are notified when the native theme changes.
class NATIVE_THEME_EXPORT NativeThemeObserver {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeObserver {
public:
// Called when the native theme changes. The observed theme is passed so that
// observers may handle changes to their associated native theme instances.

@ -6,7 +6,7 @@
#include <string_view>
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace ui {

@ -7,8 +7,8 @@
#include <string_view>
#include "base/component_export.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_export.h"
namespace ui {
@ -17,10 +17,10 @@ namespace ui {
// functions are called.
// Converts NativeTheme::ColorScheme.
std::string_view NATIVE_THEME_EXPORT
NativeThemeColorSchemeName(NativeTheme::ColorScheme color_scheme);
std::string_view COMPONENT_EXPORT(NATIVE_THEME)
NativeThemeColorSchemeName(NativeTheme::ColorScheme color_scheme);
NATIVE_THEME_EXPORT bool IsOverlayScrollbarEnabled();
COMPONENT_EXPORT(NATIVE_THEME) bool IsOverlayScrollbarEnabled();
} // namespace ui

@ -14,6 +14,7 @@
#include <optional>
#include "base/component_export.h"
#include "base/no_destructor.h"
#include "base/win/registry.h"
#include "third_party/skia/include/core/SkColor.h"
@ -31,8 +32,9 @@ namespace ui {
// of several PaintXXX methods to an API, inherited from the NativeTheme base
// class, that consists of a single Paint() method with a argument to indicate
// what kind of part to paint.
class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme,
public gfx::SysColorChangeListener {
class COMPONENT_EXPORT(NATIVE_THEME) NativeThemeWin
: public NativeTheme,
public gfx::SysColorChangeListener {
public:
enum ThemeName {
BUTTON,

@ -8,7 +8,7 @@
#include "base/feature_list.h"
#include "base/task/single_thread_task_runner.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/features/native_theme_features.h"
namespace ui {

@ -5,20 +5,20 @@
#ifndef UI_NATIVE_THEME_SCROLLBAR_ANIMATOR_MAC_H_
#define UI_NATIVE_THEME_SCROLLBAR_ANIMATOR_MAC_H_
#include "base/component_export.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "ui/gfx/animation/keyframe/timing_function.h"
#include "ui/native_theme/native_theme_export.h"
namespace ui {
// Timer used for animating scrollbar effects.
// TODO(crbug.com/40626921): Change this to be driven by the client
// (Blink or Views) animation system.
class NATIVE_THEME_EXPORT ScrollbarAnimationTimerMac {
class COMPONENT_EXPORT(NATIVE_THEME) ScrollbarAnimationTimerMac {
public:
ScrollbarAnimationTimerMac(
base::RepeatingCallback<void(double)> callback,
@ -41,7 +41,7 @@ class NATIVE_THEME_EXPORT ScrollbarAnimationTimerMac {
std::unique_ptr<gfx::CubicBezierTimingFunction> timing_function_;
};
class NATIVE_THEME_EXPORT OverlayScrollbarAnimatorMac {
class COMPONENT_EXPORT(NATIVE_THEME) OverlayScrollbarAnimatorMac {
public:
class Client {
public:

@ -12,6 +12,7 @@ test("ui_unittests") {
"//base/test:test_support",
"//testing/gtest",
"//ui/base",
"//ui/color:unit_tests",
"//ui/menus:unit_tests",
]
@ -19,10 +20,6 @@ test("ui_unittests") {
deps += [ "//ui/actions:unit_tests" ]
}
if (use_blink) {
deps += [ "//ui/color:unit_tests" ]
}
if (is_mac) {
deps += [ "//ui/base:ui_unittests_framework" ]
}