#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/drag_drop_client_observer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/base/data_transfer_policy/data_transfer_policy_controller.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drop_target_event.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h"
#include "ui/compositor/layer.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/widget/widget.h"
namespace views {
namespace {
DragOperation;
constexpr uint32_t kMinAlpha = …;
bool IsValidDragImage(const gfx::ImageSkia& image) { … }
std::unique_ptr<Widget> CreateDragWidget(
const gfx::Point& root_location,
const gfx::ImageSkia& image,
const gfx::Vector2d& drag_widget_offset) { … }
void DropIfAllowed(const ui::OSExchangeData* drag_data,
aura::client::DragUpdateInfo& drag_info,
base::OnceClosure drop_cb) { … }
void PerformDrop(aura::client::DragDropDelegate::DropCallback drop_cb,
std::unique_ptr<ui::OSExchangeData> data_to_drop,
base::ScopedClosureRunner drag_cancel) { … }
}
DesktopDragDropClientOzone::DragContext::DragContext() = default;
DesktopDragDropClientOzone::DragContext::~DragContext() = default;
DesktopDragDropClientOzone::DesktopDragDropClientOzone(
aura::Window* root_window,
ui::WmDragHandler* drag_handler)
: … { … }
DesktopDragDropClientOzone::~DesktopDragDropClientOzone() { … }
DragOperation DesktopDragDropClientOzone::StartDragAndDrop(
std::unique_ptr<ui::OSExchangeData> data,
aura::Window* root_window,
aura::Window* source_window,
const gfx::Point& root_location,
int allowed_operations,
ui::mojom::DragEventSource source) { … }
#if BUILDFLAG(IS_LINUX)
void DesktopDragDropClientOzone::UpdateDragImage(const gfx::ImageSkia& image,
const gfx::Vector2d& offset) { … }
#endif
void DesktopDragDropClientOzone::DragCancel() { … }
bool DesktopDragDropClientOzone::IsDragDropInProgress() { … }
void DesktopDragDropClientOzone::AddObserver(
aura::client::DragDropClientObserver* observer) { … }
void DesktopDragDropClientOzone::RemoveObserver(
aura::client::DragDropClientObserver* observer) { … }
void DesktopDragDropClientOzone::OnDragEnter(const gfx::PointF& location,
int operations,
int modifiers) { … }
void DesktopDragDropClientOzone::OnDragDataAvailable(
std::unique_ptr<ui::OSExchangeData> data) { … }
int DesktopDragDropClientOzone::OnDragMotion(const gfx::PointF& location,
int operations,
int modifiers) { … }
void DesktopDragDropClientOzone::OnDragDrop(int modifiers) { … }
void DesktopDragDropClientOzone::OnDragLeave() { … }
void DesktopDragDropClientOzone::OnWindowDestroyed(aura::Window* window) { … }
ui::WmDragHandler::LocationDelegate*
DesktopDragDropClientOzone::GetLocationDelegate() { … }
void DesktopDragDropClientOzone::OnDragStarted() { … }
void DesktopDragDropClientOzone::OnDragFinished(DragOperation operation) { … }
std::unique_ptr<ui::DropTargetEvent>
DesktopDragDropClientOzone::UpdateTargetAndCreateDropEvent() { … }
void DesktopDragDropClientOzone::ResetDragDropTarget(bool send_exit) { … }
}