Move OnCursorChange from CefRenderHandler to CefDisplayHandler

The cursor change can now be handled by the client with both windowed and
off-screen rendering.

Returning true from OnCursorChange will disable the default cursor change
behavior. This is functionally equivalent to the
CefBrowserHost::SetMouseCursorChangeDisabled method, so that method has been
removed.
This commit is contained in:
Marshall Greenblatt
2020-10-28 12:30:54 -04:00
parent 4e6c558bf2
commit 023d218104
38 changed files with 282 additions and 354 deletions

View File

@@ -0,0 +1,27 @@
// Copyright 2020 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_NATIVE_CURSOR_UTIL_H_
#define CEF_LIBCEF_BROWSER_NATIVE_CURSOR_UTIL_H_
#include "include/internal/cef_types.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-forward.h"
class CefBrowserHostBase;
namespace cursor_util {
#if defined(USE_AURA)
cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type);
cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor);
#endif // defined(USE_AURA)
// Returns true if the client handled the cursor change.
bool OnCursorChange(CefBrowserHostBase* browser, const ui::Cursor& ui_cursor);
} // namespace cursor_util
#endif // CEF_LIBCEF_BROWSER_NATIVE_CURSOR_UTIL_H_