views: Support themes for Alloy BrowserView in Chrome Window (see #3681)

To test:
- Run `cefclient --enable-chrome-runtime --use-alloy-style
                 --use-chrome-style-window [--background-color=green]`
- OS and Chrome theme changes behave as expected.
This commit is contained in:
Marshall Greenblatt
2024-05-01 17:56:30 -04:00
parent b92749a58a
commit 7328b9e40d
6 changed files with 192 additions and 90 deletions

View File

@@ -6,6 +6,8 @@
#define CEF_LIBCEF_BROWSER_VIEWS_WIDGET_H_
#pragma once
#include "ui/color/color_provider_key.h"
class CefWindowView;
class Profile;
@@ -42,7 +44,6 @@ class CefWidget {
// Track all Profiles associated with this Widget. Called from
// CefBrowserViewImpl::AddedToWidget and DisassociateFromWidget.
// |profile| is only used with the Alloy runtime.
virtual void AddAssociatedProfile(Profile* profile) = 0;
virtual void RemoveAssociatedProfile(Profile* profile) = 0;
@@ -59,6 +60,10 @@ class CefWidget {
protected:
virtual ~CefWidget() = default;
static ui::ColorProviderKey GetColorProviderKey(
const ui::ColorProviderKey& widget_key,
Profile* profile);
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_WIDGET_H_