mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=07f16fe4afc8f6c558d40bdc2852a27920dd779c$
|
||||
// $hash=bf57f469c4dc266377346d8874406c437b682112$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h"
|
||||
@@ -486,6 +486,28 @@ void CefBrowserViewDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefBrowserViewDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefBrowserViewDelegateCToCpp::CefBrowserViewDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a10c42b7075bc78e51a99ff5aa7da9effa4fe6f5$
|
||||
// $hash=b7d2905473b08d50a876b01f9e6a275316166c72$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
|
||||
@@ -74,6 +74,7 @@ class CefBrowserViewDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BROWSER_VIEW_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=68df0ecd51479bdc9f55fb605933ac10ca15affd$
|
||||
// $hash=564f44a20f3eab8c45fe840cb8d65f399f3ee0db$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/button_delegate_ctocpp.h"
|
||||
@@ -318,6 +318,28 @@ void CefButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefButtonDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefButtonDelegateCToCpp::CefButtonDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=53e751a5b54ab964ee2aef1a8232a9647f47db00$
|
||||
// $hash=0e50e8cd82200398ce91a03a6c0ef51da5ac956b$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_
|
||||
@@ -56,6 +56,7 @@ class CefButtonDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_BUTTON_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f65b17eb26f40ebf503684544969eed98dcabd9b$
|
||||
// $hash=a6485751f5491da5b4a762d8f70c80fec73d0a95$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h"
|
||||
@@ -353,6 +353,28 @@ void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefMenuButtonDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a95e80394596beec91e6f8915fed15fdd52bea96$
|
||||
// $hash=99795614556ff22cbcbac94cfb9f4794e5fe5c81$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_
|
||||
@@ -62,6 +62,7 @@ class CefMenuButtonDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_MENU_BUTTON_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=eeb999ed9ff1b98afba6cc6d0c4c7917c4d28230$
|
||||
// $hash=96114a38e7bbf499fcb245d029164975b8d10ebe$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/panel_delegate_ctocpp.h"
|
||||
@@ -274,6 +274,28 @@ void CefPanelDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefPanelDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPanelDelegateCToCpp::CefPanelDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=26cc71f954f212dae798b7c0ffb99f9ec7b8caac$
|
||||
// $hash=74dcb25fa301e2442b1275efa20421e0477b47e0$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_
|
||||
@@ -52,6 +52,7 @@ class CefPanelDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_PANEL_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=974d55311d65e2bea484c9c8721e138018f4ab10$
|
||||
// $hash=6bb6403f617d98d48362f9038b648a176b67e585$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h"
|
||||
@@ -323,6 +323,28 @@ void CefTextfieldDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefTextfieldDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTextfieldDelegateCToCpp::CefTextfieldDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=343716f91bef33f5c84bd269d5755b142010f8be$
|
||||
// $hash=c8a4c746300947cd664bbea7b85811e77f7f7bc4$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_
|
||||
@@ -57,6 +57,7 @@ class CefTextfieldDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_TEXTFIELD_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=db639bf9fe95b7a04e6d126b32ba4ba797a82ef0$
|
||||
// $hash=4a5c6a3e8b378e785f57c0749926b380cc29ad43$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h"
|
||||
@@ -269,6 +269,27 @@ void CefViewDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefViewDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefViewDelegateCToCpp::CefViewDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=e6d59b73a62b960955749e557d300f656a95297c$
|
||||
// $hash=de93178ea96887a8dc558c96f46f2ed075fae0a6$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_
|
||||
@@ -51,6 +51,7 @@ class CefViewDelegateCToCpp : public CefCToCppRefCounted<CefViewDelegateCToCpp,
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_VIEW_DELEGATE_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=cfe4f7b7980000ea0bf223db0d717ed44e8b880b$
|
||||
// $hash=1d798c20b6e7325b2e769185739288682b037960$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
|
||||
@@ -766,6 +766,28 @@ void CefWindowDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
|
||||
_struct->on_blur(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefWindowDelegateCToCpp::OnThemeChanged(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_view_delegate_t* _struct =
|
||||
reinterpret_cast<cef_view_delegate_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, on_theme_changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: view; type: refptr_diff
|
||||
DCHECK(view.get());
|
||||
if (!view.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_theme_changed(_struct, CefViewCppToC::Wrap(view));
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefWindowDelegateCToCpp::CefWindowDelegateCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=ffa207a19ab4e538ce2f6071584c56c82233921c$
|
||||
// $hash=80e6d33af9304311baec72c039930dc22d38bd53$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
|
||||
@@ -82,6 +82,7 @@ class CefWindowDelegateCToCpp
|
||||
const CefRect& new_bounds) override;
|
||||
void OnFocus(CefRefPtr<CefView> view) override;
|
||||
void OnBlur(CefRefPtr<CefView> view) override;
|
||||
void OnThemeChanged(CefRefPtr<CefView> view) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
|
||||
|
Reference in New Issue
Block a user