chromium/ui/views/widget/desktop_aura/desktop_drag_drop_client_ozone.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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;

// The minimum alpha required so we would treat the pixel as visible.
constexpr uint32_t kMinAlpha =;

// Returns true if |image| has any visible regions (defined as having a pixel
// with alpha > |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) {}

// Drops the dragged data if no policy restrictions exist (Data Leak Prevention
// stack uninitialised) or if there are rules allowing the data transfer.
// Otherwise the drag is cancelled.
void DropIfAllowed(const ui::OSExchangeData* drag_data,
                   aura::client::DragUpdateInfo& drag_info,
                   base::OnceClosure drop_cb) {}

// A callback that runs the drop closure, if there is one, to perform the data
// drop. If this callback is destroyed without running, the |drag_cancel|
// closure will run.
void PerformDrop(aura::client::DragDropDelegate::DropCallback drop_cb,
                 std::unique_ptr<ui::OSExchangeData> data_to_drop,
                 base::ScopedClosureRunner drag_cancel) {}

}  // namespace

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  // BUILDFLAG(LINUX)

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) {}

}  // namespace views