Expose drag image via CefDragData (issue #1715)

This commit is contained in:
Marshall Greenblatt
2017-05-11 14:22:21 -04:00
parent eaa0942690
commit 67e23b472a
9 changed files with 192 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#pragma once
#include "include/cef_drag_data.h"
#include "include/cef_image.h"
#include <vector>
@ -18,6 +19,9 @@ class CefDragDataImpl : public CefDragData {
public:
CefDragDataImpl();
explicit CefDragDataImpl(const content::DropData& data);
CefDragDataImpl(const content::DropData& data,
CefRefPtr<CefImage> image,
const CefPoint& image_hotspot);
CefRefPtr<CefDragData> Clone() override;
bool IsReadOnly() override;
@ -41,6 +45,9 @@ class CefDragDataImpl : public CefDragData {
void SetFragmentBaseURL(const CefString& fragment) override;
void ResetFileContents() override;
void AddFile(const CefString& path, const CefString& display_name) override;
CefRefPtr<CefImage> GetImage() override;
CefPoint GetImageHotspot() override;
bool HasImage() override;
// This method is not safe. Use Lock/Unlock to get mutually exclusive access.
content::DropData* drop_data() {
@ -53,6 +60,8 @@ class CefDragDataImpl : public CefDragData {
private:
content::DropData data_;
CefRefPtr<CefImage> image_;
CefPoint image_hotspot_;
// True if this object is read-only.
bool read_only_;