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

@ -19,6 +19,15 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
read_only_(false) {
}
CefDragDataImpl::CefDragDataImpl(const content::DropData& data,
CefRefPtr<CefImage> image,
const CefPoint& image_hotspot)
: data_(data),
image_(image),
image_hotspot_(image_hotspot),
read_only_(false) {
}
CefDragDataImpl::CefDragDataImpl()
: read_only_(false) {
}
@ -31,7 +40,7 @@ CefRefPtr<CefDragData> CefDragDataImpl::Clone() {
CefDragDataImpl* drag_data = NULL;
{
base::AutoLock lock_scope(lock_);
drag_data = new CefDragDataImpl(data_);
drag_data = new CefDragDataImpl(data_, image_, image_hotspot_);
}
return drag_data;
}
@ -187,3 +196,18 @@ void CefDragDataImpl::SetReadOnly(bool read_only) {
read_only_ = read_only;
}
CefRefPtr<CefImage> CefDragDataImpl::GetImage() {
base::AutoLock lock_scope(lock_);
return image_;
}
CefPoint CefDragDataImpl::GetImageHotspot() {
base::AutoLock lock_scope(lock_);
return image_hotspot_;
}
bool CefDragDataImpl::HasImage() {
base::AutoLock lock_scope(lock_);
return image_ ? true : false;
}