mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Delete Alloy bootstrap (fixes #3685)
This commit is contained in:
@@ -294,16 +294,6 @@ bool TestOldResourceAPI() {
|
||||
return state;
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
bool IsChromeBootstrap() {
|
||||
static bool state = []() {
|
||||
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
client::switches::kEnableChromeRuntime);
|
||||
}();
|
||||
return state;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool UseViewsGlobal() {
|
||||
static bool use_views = []() {
|
||||
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
@@ -314,12 +304,6 @@ bool UseViewsGlobal() {
|
||||
|
||||
bool UseAlloyStyleBrowserGlobal() {
|
||||
static bool use_alloy_style = []() {
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
if (!IsChromeBootstrap()) {
|
||||
// Alloy runtime always uses Alloy style.
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
client::switches::kUseAlloyStyle);
|
||||
}();
|
||||
@@ -328,12 +312,6 @@ bool UseAlloyStyleBrowserGlobal() {
|
||||
|
||||
bool UseAlloyStyleWindowGlobal() {
|
||||
static bool use_alloy_style = []() {
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
if (!IsChromeBootstrap()) {
|
||||
// Alloy runtime always uses Alloy style.
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
auto command_line = CefCommandLine::GetGlobalCommandLine();
|
||||
return command_line->HasSwitch(client::switches::kUseAlloyStyle) &&
|
||||
!command_line->HasSwitch(client::switches::kUseChromeStyleWindow);
|
||||
@@ -344,51 +322,26 @@ bool UseAlloyStyleWindowGlobal() {
|
||||
std::string ComputeViewsWindowTitle(CefRefPtr<CefWindow> window,
|
||||
CefRefPtr<CefBrowserView> browser_view) {
|
||||
std::string title = "CefTest - Views - ";
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
if (!IsChromeBootstrap()) {
|
||||
title += "Alloy";
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
title += "Chrome - ";
|
||||
#endif
|
||||
std::string window_style =
|
||||
window->GetRuntimeStyle() == CEF_RUNTIME_STYLE_CHROME ? "Chrome"
|
||||
: "Alloy";
|
||||
title += window_style + " Window";
|
||||
if (browser_view) {
|
||||
std::string browser_style =
|
||||
browser_view->GetRuntimeStyle() == CEF_RUNTIME_STYLE_CHROME ? "Chrome"
|
||||
: "Alloy";
|
||||
title += " - " + browser_style + " BrowserView";
|
||||
}
|
||||
std::string window_style =
|
||||
window->GetRuntimeStyle() == CEF_RUNTIME_STYLE_CHROME ? "Chrome"
|
||||
: "Alloy";
|
||||
title += window_style + " Window";
|
||||
if (browser_view) {
|
||||
std::string browser_style =
|
||||
browser_view->GetRuntimeStyle() == CEF_RUNTIME_STYLE_CHROME ? "Chrome"
|
||||
: "Alloy";
|
||||
title += " - " + browser_style + " BrowserView";
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
std::string ComputeNativeWindowTitle(bool use_alloy_style) {
|
||||
std::string title = "CefTest - Native - ";
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
if (!IsChromeBootstrap()) {
|
||||
title += "Alloy";
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
title += "Chrome - ";
|
||||
title += use_alloy_style ? "Alloy Browser" : "Chrome Browser";
|
||||
}
|
||||
title += use_alloy_style ? "Alloy Browser" : "Chrome Browser";
|
||||
return title;
|
||||
}
|
||||
|
||||
bool IsBFCacheEnabled() {
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
// Supported by the Chrome runtime only, see issue #3237.
|
||||
if (!IsChromeBootstrap()) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool state = []() {
|
||||
const std::string& value =
|
||||
CefCommandLine::GetGlobalCommandLine()->GetSwitchValue(
|
||||
@@ -405,11 +358,7 @@ bool IsSameSiteBFCacheEnabled() {
|
||||
}
|
||||
|
||||
bool IgnoreURL(const std::string& url) {
|
||||
return
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
IsChromeBootstrap() &&
|
||||
#endif
|
||||
url.find("/favicon.ico") != std::string::npos;
|
||||
return url.find("/favicon.ico") != std::string::npos;
|
||||
}
|
||||
|
||||
std::optional<int> GetConfiguredTestTimeout(int timeout_ms) {
|
||||
@@ -425,11 +374,7 @@ std::optional<int> GetConfiguredTestTimeout(int timeout_ms) {
|
||||
return dval;
|
||||
}
|
||||
}
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
return IsChromeBootstrap() ? 2.0 : 1.0;
|
||||
#else
|
||||
return 2.0;
|
||||
#endif
|
||||
}();
|
||||
|
||||
if (!multiplier) {
|
||||
@@ -457,28 +402,23 @@ void SendMouseClickEvent(CefRefPtr<CefBrowser> browser,
|
||||
|
||||
void GrantPopupPermission(CefRefPtr<CefRequestContext> request_context,
|
||||
const std::string& parent_url) {
|
||||
#if !defined(DISABLE_ALLOY_BOOTSTRAP)
|
||||
if (IsChromeBootstrap())
|
||||
#endif
|
||||
{
|
||||
static bool test_website_setting = []() {
|
||||
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
"test-website-setting");
|
||||
}();
|
||||
static bool test_website_setting = []() {
|
||||
return CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
"test-website-setting");
|
||||
}();
|
||||
|
||||
// The below calls are equivalent.
|
||||
// NOTE: If the popup allow functionality stops working, debug the code in
|
||||
// components/blocked_content/popup_blocker.cc
|
||||
if (test_website_setting) {
|
||||
auto value = CefValue::Create();
|
||||
value->SetInt(CEF_CONTENT_SETTING_VALUE_ALLOW);
|
||||
request_context->SetWebsiteSetting(
|
||||
parent_url, parent_url, CEF_CONTENT_SETTING_TYPE_POPUPS, value);
|
||||
} else {
|
||||
request_context->SetContentSetting(parent_url, parent_url,
|
||||
CEF_CONTENT_SETTING_TYPE_POPUPS,
|
||||
CEF_CONTENT_SETTING_VALUE_ALLOW);
|
||||
}
|
||||
// The below calls are equivalent.
|
||||
// NOTE: If the popup allow functionality stops working, debug the code in
|
||||
// components/blocked_content/popup_blocker.cc
|
||||
if (test_website_setting) {
|
||||
auto value = CefValue::Create();
|
||||
value->SetInt(CEF_CONTENT_SETTING_VALUE_ALLOW);
|
||||
request_context->SetWebsiteSetting(parent_url, parent_url,
|
||||
CEF_CONTENT_SETTING_TYPE_POPUPS, value);
|
||||
} else {
|
||||
request_context->SetContentSetting(parent_url, parent_url,
|
||||
CEF_CONTENT_SETTING_TYPE_POPUPS,
|
||||
CEF_CONTENT_SETTING_VALUE_ALLOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user