2020-10-28 17:30:54 +01:00
|
|
|
// 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_
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
#include <memory>
|
|
|
|
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/cef_browser.h"
|
2020-10-28 17:30:54 +01:00
|
|
|
#include "ui/base/cursor/cursor.h"
|
|
|
|
#include "ui/base/cursor/mojom/cursor_type.mojom-forward.h"
|
|
|
|
|
2021-06-04 03:34:56 +02:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
#include "ui/base/cursor/platform_cursor.h"
|
|
|
|
#endif
|
|
|
|
|
2020-10-28 17:30:54 +01:00
|
|
|
namespace cursor_util {
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
// Scoped ownership of a native cursor handle.
|
|
|
|
class ScopedCursorHandle {
|
|
|
|
public:
|
|
|
|
virtual ~ScopedCursorHandle() = default;
|
|
|
|
|
|
|
|
static std::unique_ptr<ScopedCursorHandle> Create(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const ui::Cursor& ui_cursor);
|
|
|
|
|
|
|
|
virtual cef_cursor_handle_t GetCursorHandle() = 0;
|
|
|
|
};
|
2020-10-28 17:30:54 +01:00
|
|
|
|
|
|
|
// Returns true if the client handled the cursor change.
|
2022-04-08 22:48:56 +02:00
|
|
|
bool OnCursorChange(CefRefPtr<CefBrowser> browser, const ui::Cursor& ui_cursor);
|
2020-10-28 17:30:54 +01:00
|
|
|
|
|
|
|
} // namespace cursor_util
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_NATIVE_CURSOR_UTIL_H_
|