mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 111.0.5563.0 (#1097615)
This commit is contained in:
38
libcef/browser/native/cursor_util_mac.mm
Normal file
38
libcef/browser/native/cursor_util_mac.mm
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright 2023 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.
|
||||
|
||||
#include "libcef/browser/native/cursor_util.h"
|
||||
|
||||
#import "base/mac/scoped_nsobject.h"
|
||||
#import "ui/base/cocoa/cursor_utils.h"
|
||||
|
||||
namespace cursor_util {
|
||||
|
||||
namespace {
|
||||
|
||||
class ScopedCursorHandleImpl : public ScopedCursorHandle {
|
||||
public:
|
||||
explicit ScopedCursorHandleImpl(NSCursor* native_cursor) {
|
||||
if (native_cursor) {
|
||||
cursor_.reset([native_cursor retain]);
|
||||
}
|
||||
}
|
||||
|
||||
cef_cursor_handle_t GetCursorHandle() override { return cursor_.get(); }
|
||||
|
||||
private:
|
||||
base::scoped_nsobject<NSCursor> cursor_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
std::unique_ptr<ScopedCursorHandle> ScopedCursorHandle::Create(
|
||||
CefRefPtr<CefBrowser> /*browser*/,
|
||||
const ui::Cursor& ui_cursor) {
|
||||
return std::make_unique<ScopedCursorHandleImpl>(
|
||||
ui::GetNativeCursor(ui_cursor));
|
||||
}
|
||||
|
||||
} // namespace cursor_util
|
Reference in New Issue
Block a user