views: Use default theme background color for all controls (see #3671)

Add new CefViewDelegate::OnThemeChanged callback for optionally overriding
default theme colors when the current theme changes.
This commit is contained in:
Marshall Greenblatt
2024-03-22 19:51:00 -04:00
parent a13b6dc7f6
commit 19ba8b2b8d
43 changed files with 510 additions and 102 deletions

View File

@@ -9,6 +9,7 @@
#include "include/views/cef_view.h"
#include "include/views/cef_window.h"
#include "ui/color/color_id.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/view.h"
@@ -45,7 +46,6 @@ class CefWindowDelegate;
namespace view_util {
// Default values.
extern const SkColor kDefaultBackgroundColor;
extern const char kDefaultFontList[];
// Called when a CefView is initialized to create the initial association
@@ -165,6 +165,11 @@ views::View* GetHostView(views::Widget* widget);
float GetNSWindowTitleBarHeight(views::Widget* widget);
#endif
// Returns the mixer color for |id|. If |view| has been added to a Widget it
// will use the Widget's ColorProvider, otherwise it will use the default theme
// ColorProvider. Returns gfx::kPlaceholderColor if |id| cannot be constructed.
SkColor GetColor(views::View* view, ui::ColorId id);
} // namespace view_util
#endif // CEF_LIBCEF_BROWSER_VIEWS_VIEW_UTIL_H_