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:
@@ -15,7 +15,6 @@
|
||||
#include "cef/libcef/browser/thread_util.h"
|
||||
#include "cef/libcef/browser/views/widget.h"
|
||||
#include "cef/libcef/browser/views/window_impl.h"
|
||||
#include "cef/libcef/features/runtime.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/input/native_web_keyboard_event.h"
|
||||
#include "ui/content_accelerators/accelerator_util.h"
|
||||
@@ -39,17 +38,8 @@ std::optional<cef_gesture_command_t> GetGestureCommand(
|
||||
bool ComputeAlloyStyle(CefBrowserViewDelegate* cef_delegate,
|
||||
bool is_devtools_popup) {
|
||||
// Alloy style is not supported with Chrome DevTools popups.
|
||||
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
const bool supports_alloy_style =
|
||||
cef::IsAlloyRuntimeEnabled() || !is_devtools_popup;
|
||||
const bool supports_chrome_style = cef::IsChromeRuntimeEnabled();
|
||||
const auto default_style = cef::IsAlloyRuntimeEnabled()
|
||||
? CEF_RUNTIME_STYLE_ALLOY
|
||||
: CEF_RUNTIME_STYLE_CHROME;
|
||||
#else
|
||||
const bool supports_alloy_style = !is_devtools_popup;
|
||||
const auto default_style = CEF_RUNTIME_STYLE_CHROME;
|
||||
#endif
|
||||
|
||||
auto result_style = default_style;
|
||||
|
||||
@@ -63,17 +53,8 @@ bool ComputeAlloyStyle(CefBrowserViewDelegate* cef_delegate,
|
||||
"Chrome style is supported";
|
||||
}
|
||||
} else if (requested_style == CEF_RUNTIME_STYLE_CHROME) {
|
||||
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
if (supports_chrome_style) {
|
||||
result_style = requested_style;
|
||||
} else {
|
||||
LOG(ERROR) << "GetBrowserRuntimeStyle() requested Chrome style; only "
|
||||
"Alloy style is supported";
|
||||
}
|
||||
#else
|
||||
// Chrome style is always supported.
|
||||
result_style = requested_style;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +244,7 @@ void CefBrowserViewImpl::Detach() {
|
||||
DCHECK(!root_view());
|
||||
|
||||
if (browser_) {
|
||||
// With the Alloy runtime |browser_| will disappear when WindowDestroyed()
|
||||
// With Alloy style |browser_| will disappear when WindowDestroyed()
|
||||
// indirectly calls BrowserDestroyed() so keep a reference.
|
||||
CefRefPtr<CefBrowserHostBase> browser = browser_;
|
||||
|
||||
@@ -320,7 +301,7 @@ void CefBrowserViewImpl::AddedToWidget() {
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::RemovedFromWidget() {
|
||||
// With Chrome runtime this may be called after BrowserDestroyed(), in which
|
||||
// With Chrome style this may be called after BrowserDestroyed(), in which
|
||||
// case the following call will be a no-op.
|
||||
DisassociateFromWidget();
|
||||
}
|
||||
@@ -338,7 +319,7 @@ bool CefBrowserViewImpl::OnGestureEvent(ui::GestureEvent* event) {
|
||||
}
|
||||
|
||||
if (is_alloy_style_ && browser_) {
|
||||
// Default handling for the Alloy runtime.
|
||||
// Default handling for Alloy style.
|
||||
switch (*command) {
|
||||
case CEF_GESTURE_COMMAND_BACK:
|
||||
browser_->GoBack();
|
||||
|
@@ -16,9 +16,9 @@ class Widget;
|
||||
}
|
||||
|
||||
// Interface that provides access to common CEF-specific Widget functionality.
|
||||
// Alloy and Chrome runtimes use different views::Widget inheritance so we can't
|
||||
// cast types directly. Implemented by CefWidgetImpl for the Alloy runtime and
|
||||
// ChromeBrowserFrame for the Chrome runtime.
|
||||
// Alloy and Chrome styles use different views::Widget inheritance so we can't
|
||||
// cast types directly. Implemented by CefWidgetImpl for Alloy style and
|
||||
// ChromeBrowserFrame for Chrome style.
|
||||
class CefWidget {
|
||||
public:
|
||||
// Called from CefWindowView::CreateWidget.
|
||||
@@ -48,7 +48,7 @@ class CefWidget {
|
||||
virtual void RemoveAssociatedProfile(Profile* profile) = 0;
|
||||
|
||||
// Returns the Profile that will be used for Chrome theme purposes. Chrome
|
||||
// runtime supports a single BrowserView in a single Widget. Alloy runtime
|
||||
// style supports a single BrowserView in a single Widget. Alloy style
|
||||
// supports multiple BrowserViews in a single Widget, and those BrowserViews
|
||||
// may have different Profiles. If there are multiple Profiles we return an
|
||||
// arbitrary one. The returned Profile will remain consistent until the set of
|
||||
|
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "cef/libcef/browser/thread_util.h"
|
||||
#include "cef/libcef/browser/views/window_view.h"
|
||||
#include "cef/libcef/features/runtime.h"
|
||||
#include "chrome/browser/themes/custom_theme_supplier.h"
|
||||
#include "chrome/browser/themes/theme_service.h"
|
||||
#include "chrome/browser/themes/theme_service_factory.h"
|
||||
|
@@ -18,7 +18,7 @@
|
||||
class CefWindowView;
|
||||
class Profile;
|
||||
|
||||
// Widget specialization to implement theme support for the Alloy runtime. The
|
||||
// Widget specialization to implement theme support for Alloy style. The
|
||||
// global NativeTheme (native/OS theme) will be used unless this Widget contains
|
||||
// a BrowserView, in which case a Chrome theme associated with the BrowserView's
|
||||
// Profile will be used.
|
||||
|
@@ -258,14 +258,14 @@ void CefWindowImpl::SetFullscreen(bool fullscreen) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Call the Widget method directly with Alloy runtime, or Chrome runtime
|
||||
// Call the Widget method directly with Alloy style, or Chrome style
|
||||
// when no BrowserView exists.
|
||||
widget_->SetFullscreen(fullscreen);
|
||||
|
||||
// Use a synchronous callback notification on Windows/Linux. Chrome runtime
|
||||
// Use a synchronous callback notification on Windows/Linux. Chrome style
|
||||
// on Windows/Linux gets notified synchronously via ChromeBrowserDelegate
|
||||
// callbacks when a BrowserView exists. MacOS (both runtimes) gets notified
|
||||
// asynchronously via CefNativeWidgetMac callbacks.
|
||||
// callbacks when a BrowserView exists. MacOS (both runtime styles) gets
|
||||
// notified asynchronously via CefNativeWidgetMac callbacks.
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
if (delegate()) {
|
||||
delegate()->OnWindowFullscreenTransition(this, /*is_completed=*/true);
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include "cef/libcef/browser/image_impl.h"
|
||||
#include "cef/libcef/browser/views/widget.h"
|
||||
#include "cef/libcef/browser/views/window_impl.h"
|
||||
#include "cef/libcef/features/runtime.h"
|
||||
#include "ui/base/hit_test.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
@@ -357,36 +356,15 @@ void UpdateModalDialogPosition(views::Widget* widget,
|
||||
}
|
||||
|
||||
bool ComputeAlloyStyle(CefWindowDelegate* cef_delegate) {
|
||||
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
const bool supports_chrome_style = cef::IsChromeRuntimeEnabled();
|
||||
const auto default_style = cef::IsAlloyRuntimeEnabled()
|
||||
? CEF_RUNTIME_STYLE_ALLOY
|
||||
: CEF_RUNTIME_STYLE_CHROME;
|
||||
#else
|
||||
const auto default_style = CEF_RUNTIME_STYLE_CHROME;
|
||||
#endif
|
||||
|
||||
auto result_style = default_style;
|
||||
|
||||
if (cef_delegate) {
|
||||
auto requested_style = cef_delegate->GetWindowRuntimeStyle();
|
||||
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
if (requested_style == CEF_RUNTIME_STYLE_ALLOY) {
|
||||
// Alloy style is always supported.
|
||||
result_style = requested_style;
|
||||
} else if (requested_style == CEF_RUNTIME_STYLE_CHROME) {
|
||||
if (supports_chrome_style) {
|
||||
result_style = requested_style;
|
||||
} else {
|
||||
LOG(ERROR) << "GetWindowRuntimeStyle() requested Chrome style; only "
|
||||
"Alloy style is supported";
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (requested_style != CEF_RUNTIME_STYLE_DEFAULT) {
|
||||
result_style = requested_style;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return result_style == CEF_RUNTIME_STYLE_ALLOY;
|
||||
|
Reference in New Issue
Block a user