2015-11-17 19:20:13 +01:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "libcef/browser/osr/render_widget_host_view_osr.h"
|
|
|
|
|
2020-10-08 21:54:42 +02:00
|
|
|
#include "ui/base/cursor/cursor_factory.h"
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2019-04-23 19:00:14 +02:00
|
|
|
#if defined(USE_X11)
|
2020-10-08 21:54:42 +02:00
|
|
|
#include "ui/base/x/x11_cursor.h"
|
|
|
|
#endif
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2020-10-08 21:54:42 +02:00
|
|
|
CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor(
|
|
|
|
ui::mojom::CursorType type) {
|
|
|
|
auto cursor = ui::CursorFactory::GetInstance()->GetDefaultCursor(type);
|
|
|
|
if (cursor) {
|
|
|
|
return ToCursorHandle(*cursor);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-10-08 21:54:42 +02:00
|
|
|
CefCursorHandle CefRenderWidgetHostViewOSR::ToCursorHandle(
|
|
|
|
ui::PlatformCursor cursor) {
|
2019-04-23 19:00:14 +02:00
|
|
|
#if defined(USE_X11)
|
2020-10-08 21:54:42 +02:00
|
|
|
// See https://crbug.com/1029142 for background.
|
|
|
|
return static_cast<CefCursorHandle>(
|
|
|
|
static_cast<ui::X11Cursor*>(cursor)->xcursor());
|
|
|
|
#else
|
|
|
|
return cursor;
|
|
|
|
#endif
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|