mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 86.0.4240.0 (#800218)
- CefURLRequest::Create is no longer supported in the renderer process (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead. - Mac platform definitions have been changed from `MACOSX` to `MAC` (see https://crbug.com/1105907) and related CMake macro names have been updated. The old `OS_MACOSX` define is still set in code and CMake for backwards compatibility. - Linux ARM build is currently broken (see https://crbug.com/1123214).
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
#include "libcef/browser/osr/web_contents_view_osr.h"
|
||||
#include "libcef/common/drag_data_impl.h"
|
||||
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/task/current_thread.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
@ -482,7 +482,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
|
||||
CefRefPtr<CefDragDataImpl> drag_data(
|
||||
new CefDragDataImpl(drop_data, cef_image, cef_image_pos));
|
||||
drag_data->SetReadOnly(true);
|
||||
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
|
||||
base::CurrentThread::ScopedNestableTaskAllower allow;
|
||||
handled = handler->StartDragging(
|
||||
browser_, drag_data.get(),
|
||||
static_cast<CefRenderHandler::DragOperationsMask>(allowed_ops),
|
||||
|
@ -150,6 +150,12 @@ struct PopulateAxNodeAttributes {
|
||||
attributes->SetString(ToString(attr.first), ToString(state));
|
||||
}
|
||||
} break;
|
||||
case ax::mojom::IntAttribute::kTextAlign: {
|
||||
auto state = static_cast<ax::mojom::TextAlign>(attr.second);
|
||||
if (ax::mojom::TextAlign::kNone != state) {
|
||||
attributes->SetString(ToString(attr.first), ToString(state));
|
||||
}
|
||||
} break;
|
||||
case ax::mojom::IntAttribute::kNameFrom:
|
||||
attributes->SetString(
|
||||
ToString(attr.first),
|
||||
@ -173,8 +179,8 @@ struct PopulateAxNodeAttributes {
|
||||
}
|
||||
} break;
|
||||
case ax::mojom::IntAttribute::kTextDirection: {
|
||||
auto state = static_cast<ax::mojom::TextDirection>(attr.second);
|
||||
if (ax::mojom::TextDirection::kNone != state) {
|
||||
auto state = static_cast<ax::mojom::WritingDirection>(attr.second);
|
||||
if (ax::mojom::WritingDirection::kNone != state) {
|
||||
attributes->SetString(ToString(attr.first), ToString(state));
|
||||
}
|
||||
} break;
|
||||
|
@ -55,7 +55,7 @@
|
||||
#include "ui/gfx/geometry/size_conversions.h"
|
||||
|
||||
#if defined(USE_X11)
|
||||
#include "ui/base/x/x11_cursor.h"
|
||||
#include "ui/base/x/x11_cursor_loader.h"
|
||||
#include "ui/base/x/x11_util.h"
|
||||
#endif
|
||||
|
||||
@ -67,8 +67,8 @@ const size_t kMaxDamageRects = 10;
|
||||
|
||||
const float kDefaultScaleFactor = 1.0;
|
||||
|
||||
content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
|
||||
content::ScreenInfo screenInfo;
|
||||
blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) {
|
||||
blink::ScreenInfo screenInfo;
|
||||
screenInfo.device_scale_factor = src.device_scale_factor;
|
||||
screenInfo.depth = src.depth;
|
||||
screenInfo.depth_per_component = src.depth_per_component;
|
||||
@ -101,7 +101,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
|
||||
// may not match the page's, so use black as the gutter color to avoid
|
||||
// flashes of brighter colors during the transition.
|
||||
if (view_->render_widget_host()->delegate() &&
|
||||
view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) {
|
||||
view_->render_widget_host()->delegate()->IsFullscreen()) {
|
||||
return SK_ColorBLACK;
|
||||
}
|
||||
return *view_->GetBackgroundColor();
|
||||
@ -197,7 +197,8 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
|
||||
CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) {
|
||||
#if defined(USE_X11)
|
||||
// See https://crbug.com/1029142 for background.
|
||||
return static_cast<ui::X11Cursor*>(cursor)->xcursor();
|
||||
return static_cast<CefCursorHandle>(
|
||||
static_cast<ui::X11Cursor*>(cursor)->xcursor());
|
||||
#else
|
||||
return cursor;
|
||||
#endif
|
||||
@ -654,7 +655,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
|
||||
|
||||
handler->OnCursorChange(browser_impl_.get(), platform_cursor, cursor_type,
|
||||
custom_cursor_info);
|
||||
#elif defined(OS_MACOSX)
|
||||
#elif defined(OS_MAC)
|
||||
// |web_cursor| owns the resulting |native_cursor|.
|
||||
content::WebCursor web_cursor(cursor);
|
||||
CefCursorHandle native_cursor = web_cursor.GetNativeCursor();
|
||||
@ -741,7 +742,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface(
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) {
|
||||
void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) {
|
||||
if (!browser_impl_.get())
|
||||
return;
|
||||
|
||||
@ -792,7 +793,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
|
||||
return GetViewBounds();
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
viz::ScopedSurfaceIdAllocator
|
||||
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
|
||||
const cc::RenderFrameMetadata& metadata) {
|
||||
@ -1443,13 +1444,16 @@ gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() {
|
||||
current_device_scale_factor_);
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void CefRenderWidgetHostViewOSR::SetActive(bool active) {}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
|
||||
#endif
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SetWindowFrameInScreen(const gfx::Rect& rect) {
|
||||
}
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
||||
const gfx::Size& pixel_size,
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "ui/events/gesture_detection/motion_event_generic.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
|
||||
#endif
|
||||
|
||||
@ -65,8 +65,9 @@ class CefWebContentsViewOSR;
|
||||
|
||||
#if defined(USE_X11)
|
||||
namespace ui {
|
||||
class XScopedCursor;
|
||||
}
|
||||
class X11Cursor;
|
||||
class XCursorLoader;
|
||||
} // namespace ui
|
||||
class CefWindowX11;
|
||||
#endif
|
||||
|
||||
@ -88,7 +89,7 @@ class CefWindowX11;
|
||||
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
class MacHelper;
|
||||
#endif
|
||||
|
||||
@ -129,11 +130,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
void UnlockMouse() override;
|
||||
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
void SetActive(bool active) override;
|
||||
void ShowDefinitionForSelection() override;
|
||||
void SpeakSelection() override;
|
||||
#endif // defined(OS_MACOSX)
|
||||
void SetWindowFrameInScreen(const gfx::Rect& rect) override;
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
// RenderWidgetHostViewBase implementation.
|
||||
void ResetFallbackToFirstNavigationSurface() override;
|
||||
@ -152,11 +154,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
const gfx::Rect& src_rect,
|
||||
const gfx::Size& output_size,
|
||||
base::OnceCallback<void(const SkBitmap&)> callback) override;
|
||||
void GetScreenInfo(content::ScreenInfo* results) override;
|
||||
void GetScreenInfo(blink::ScreenInfo* results) override;
|
||||
void TransformPointToRootSurface(gfx::PointF* point) override;
|
||||
gfx::Rect GetBoundsInRootWindow() override;
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#if !defined(OS_MAC)
|
||||
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
|
||||
const cc::RenderFrameMetadata& metadata) override;
|
||||
#endif
|
||||
@ -345,7 +347,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_;
|
||||
|
||||
#if defined(USE_X11)
|
||||
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
|
||||
std::unique_ptr<ui::XCursorLoader> cursor_loader_;
|
||||
scoped_refptr<ui::X11Cursor> invisible_cursor_;
|
||||
#endif
|
||||
|
||||
std::unique_ptr<content::CursorManager> cursor_manager_;
|
||||
|
@ -8,10 +8,11 @@
|
||||
#if defined(USE_X11)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#undef Status // Avoid conflicts with url_request_status.h
|
||||
|
||||
#include "libcef/browser/native/window_x11.h"
|
||||
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/base/x/x11_cursor_loader.h"
|
||||
#include "ui/base/x/x11_util.h"
|
||||
#include "ui/gfx/x/x11_types.h"
|
||||
#endif // defined(USE_X11)
|
||||
@ -176,6 +177,14 @@ XCursorCache* cursor_cache = nullptr;
|
||||
return cursor_cache->GetCursor(cursor_shape);
|
||||
}
|
||||
|
||||
// Based on ui/base/x/x11_cursor_factory.cc.
|
||||
scoped_refptr<ui::X11Cursor> CreateInvisibleCursor(
|
||||
ui::XCursorLoader* cursor_loader) {
|
||||
SkBitmap bitmap;
|
||||
bitmap.allocN32Pixels(1, 1);
|
||||
return cursor_loader->CreateCursor(bitmap, gfx::Point(0, 0));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif // defined(USE_X11)
|
||||
|
||||
@ -184,10 +193,11 @@ CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor(
|
||||
#if defined(USE_X11)
|
||||
if (type == ui::mojom::CursorType::kNone) {
|
||||
if (!invisible_cursor_) {
|
||||
invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(),
|
||||
gfx::GetXDisplay()));
|
||||
cursor_loader_ =
|
||||
std::make_unique<ui::XCursorLoader>(x11::Connection::Get());
|
||||
invisible_cursor_ = CreateInvisibleCursor(cursor_loader_.get());
|
||||
}
|
||||
return invisible_cursor_->get();
|
||||
return static_cast<::Cursor>(invisible_cursor_->xcursor());
|
||||
} else {
|
||||
return GetXCursor(ToCursorID(type));
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
|
||||
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/public/common/screen_info.h"
|
||||
#include "ui/events/gesture_detection/gesture_configuration.h"
|
||||
|
||||
CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR(
|
||||
|
@ -138,11 +138,11 @@ void CefWebContentsViewOSR::RenderViewHostChanged(
|
||||
|
||||
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
|
||||
return false;
|
||||
}
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
void CefWebContentsViewOSR::StartDragging(
|
||||
const content::DropData& drop_data,
|
||||
|
@ -56,7 +56,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
|
||||
content::RenderViewHost* new_host) override;
|
||||
void SetOverscrollControllerEnabled(bool enabled) override;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
bool CloseTabAfterEventTrackingIfNeeded() override;
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user