Commit 0fb3a386 authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Revert "Delivers drag and drop methods from Surface to DataDevice."

This reverts commit c59f6260.

Reason for revert: Broke compilation on Linux ChromiumOS Builder (dbg)

../../components/exo/data_device_delegate.h:28: error: undefined reference to 'vtable for exo::DataDeviceDelegate'
../../third_party/binutils/Linux_x64/Release/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Original change's description:
> Delivers drag and drop methods from Surface to DataDevice.
> 
> The CL lets Surface observe drag and drop events and delegates the events to
> DataDevice thorugh DataDeviceManager.
> 
> Bug: b:31988797
> Test: None
> Change-Id: I9574cd86137922d7527bd297d182a7b45e632c9e
> Reviewed-on: https://chromium-review.googlesource.com/579250
> Commit-Queue: Daichi Hirono <hirono@chromium.org>
> Reviewed-by: David Reveman <reveman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#491951}

TBR=reveman@chromium.org,hirono@chromium.org,hidehiko@chromium.org

Change-Id: Ie770510e27a19b94f5e621ef41d24138c219104c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b:31988797
Reviewed-on: https://chromium-review.googlesource.com/601989Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491984}
parent bc34c906
......@@ -6,19 +6,13 @@
#include "base/logging.h"
#include "components/exo/data_device_delegate.h"
#include "components/exo/surface.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drop_target_event.h"
namespace exo {
DataDevice::DataDevice(DataDeviceDelegate* delegate) : delegate_(delegate) {
WMHelper::GetInstance()->AddDragDropObserver(this);
}
DataDevice::DataDevice(DataDeviceDelegate* delegate) : delegate_(delegate) {}
DataDevice::~DataDevice() {
delegate_->OnDataDeviceDestroying(this);
WMHelper::GetInstance()->RemoveDragDropObserver(this);
}
void DataDevice::StartDrag(const DataSource* source_resource,
......@@ -34,32 +28,4 @@ void DataDevice::SetSelection(const DataSource* source, uint32_t serial) {
NOTIMPLEMENTED();
}
void DataDevice::OnDragEntered(const ui::DropTargetEvent& event) {
NOTIMPLEMENTED();
}
int DataDevice::OnDragUpdated(const ui::DropTargetEvent& event) {
NOTIMPLEMENTED();
return ui::DragDropTypes::DRAG_NONE;
}
void DataDevice::OnDragExited() {
NOTIMPLEMENTED();
}
int DataDevice::OnPerformDrop(const ui::DropTargetEvent& event) {
NOTIMPLEMENTED();
return ui::DragDropTypes::DRAG_NONE;
}
Surface* DataDevice::GetEffectiveTargetForEvent(
const ui::DropTargetEvent& event) const {
Surface* target =
Surface::AsSurface(static_cast<aura::Window*>(event.target()));
if (!target)
return nullptr;
return delegate_->CanAcceptDataEventsForSurface(target) ? target : nullptr;
}
} // namespace exo
......@@ -8,11 +8,6 @@
#include <cstdint>
#include "base/macros.h"
#include "components/exo/wm_helper.h"
namespace ui {
class DropTargetEvent;
}
namespace exo {
......@@ -24,10 +19,10 @@ enum class DndAction { kNone, kCopy, kMove, kAsk };
// Data transfer device providing access to inter-client data transfer
// mechanisms such as copy-and-paste and drag-and-drop.
class DataDevice : public WMHelper::DragDropObserver {
class DataDevice {
public:
explicit DataDevice(DataDeviceDelegate* delegate);
~DataDevice() override;
~DataDevice();
// Starts drag-and-drop operation.
// |source| is data source for the eventual transfer or null if data passing
......@@ -44,15 +39,7 @@ class DataDevice : public WMHelper::DragDropObserver {
// selection. |serial| is a unique number of event which tigers SetSelection.
void SetSelection(const DataSource* source, uint32_t serial);
// Overridden from WMHelper::DragDropObserver:
void OnDragEntered(const ui::DropTargetEvent& event) override;
int OnDragUpdated(const ui::DropTargetEvent& event) override;
void OnDragExited() override;
int OnPerformDrop(const ui::DropTargetEvent& event) override;
private:
Surface* GetEffectiveTargetForEvent(const ui::DropTargetEvent& event) const;
DataDeviceDelegate* const delegate_;
DISALLOW_COPY_AND_ASSIGN(DataDevice);
......
......@@ -57,10 +57,6 @@ class DataDeviceDelegate {
// Called when the data is pasted on the DataDevice.
virtual void OnSelection(const DataOffer& data_offer) = 0;
// This should return true if |surface| is a valid target for this data
// device. E.g. the surface is owned by the same client as the data device.
virtual bool CanAcceptDataEventsForSurface(Surface* surface);
protected:
virtual ~DataDeviceDelegate() {}
};
......
......@@ -2843,10 +2843,6 @@ class WaylandDataDeviceDelegate : public DataDeviceDelegate {
// Overridden from DataDeviceDelegate:
void OnDataDeviceDestroying(DataDevice* device) override { delete this; }
bool CanAcceptDataEventsForSurface(Surface* surface) override {
return surface &&
wl_resource_get_client(GetSurfaceResource(surface)) == client_;
}
class DataOffer* OnDataOffer(const std::vector<std::string>& mime_types,
const base::flat_set<DndAction>& source_actions,
DndAction dnd_action) override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment