mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefDragData::GetFilePaths to return file paths (fixes #3568)
GetFileNames now returns just the display names with a fallback to path.BaseName() if the display name is empty.
This commit is contained in:
committed by
Marshall Greenblatt
parent
4ae030fec1
commit
bdec92caf8
@ -126,7 +126,7 @@ bool CefDragDataImpl::GetFileNames(std::vector<CefString>& names) {
|
||||
for (; it != data_.filenames.end(); ++it) {
|
||||
auto name = it->display_name.value();
|
||||
if (name.empty()) {
|
||||
name = it->path.value();
|
||||
name = it->path.BaseName().value();
|
||||
}
|
||||
names.push_back(name);
|
||||
}
|
||||
@ -134,6 +134,21 @@ bool CefDragDataImpl::GetFileNames(std::vector<CefString>& names) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CefDragDataImpl::GetFilePaths(std::vector<CefString>& paths) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
if (data_.filenames.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<ui::FileInfo>::const_iterator it = data_.filenames.begin();
|
||||
for (; it != data_.filenames.end(); ++it) {
|
||||
auto path = it->path.value();
|
||||
paths.push_back(path);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CefDragDataImpl::SetLinkURL(const CefString& url) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
CHECK_READONLY_RETURN_VOID();
|
||||
|
Reference in New Issue
Block a user