Avoid possible reentrancy of ThemeChanged (see #3671)

The call to SelectNativeTheme from ChromeBrowserFrame::Initialized was
causing Widget::ThemeChanged reentrancy via OnColorProviderCacheResetMissed
when running with `--enable-chrome-runtime --use-native`. Make all calls to
ThemeChanged async to avoid this and possible future issues.
This commit is contained in:
Marshall Greenblatt
2024-04-14 21:34:45 -04:00
parent 1482ffe749
commit e461d8f247
4 changed files with 23 additions and 7 deletions

View File

@ -11,6 +11,7 @@
#include "libcef/browser/views/color_provider_tracker.h"
#include "libcef/browser/views/widget.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/themes/theme_service_observer.h"
#include "ui/views/widget/widget.h"
@ -91,6 +92,8 @@ class CefWidgetImpl : public views::Widget,
ProfileMap associated_profiles_;
CefColorProviderTracker color_provider_tracker_{this};
base::WeakPtrFactory<CefWidgetImpl> weak_ptr_factory_{this};
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_WIDGET_IMPL_H_