win/linux: Use CursorLoader for loading cursor resources (see issue #3270)

Switch to using aura::CursorLoader which knows how to load system, non-system
and pak cursor resources.

On Windows, cursors will be loaded via LoadCursor first if available with a
fallback to pak file if necessary (like with component builds).

On Linux, all non-system cursor resources will be loaded from pak file. Cursors
may be loaded asynchronously resulting in the default (pointer) cursor being
returned on the first request.
This commit is contained in:
Marshall Greenblatt
2022-04-14 18:04:40 -04:00
parent d6b2b4b144
commit b1cd9d1598
4 changed files with 75 additions and 166 deletions

View File

@@ -4,7 +4,6 @@
#include "libcef/browser/native/cursor_util.h"
#include "ui/base/cursor/cursor_factory.h"
#include "ui/ozone/buildflags.h"
#if BUILDFLAG(OZONE_PLATFORM_X11)
@@ -15,14 +14,6 @@
namespace cursor_util {
cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) {
auto cursor = ui::CursorFactory::GetInstance()->GetDefaultCursor(type);
if (cursor) {
return ToCursorHandle(cursor);
}
return 0;
}
cef_cursor_handle_t ToCursorHandle(scoped_refptr<ui::PlatformCursor> cursor) {
#if BUILDFLAG(OZONE_PLATFORM_X11)
// See https://crbug.com/1029142 for background.