Skip to content

Commit

Permalink
[GTK] Handle files being disallowed in DragDataGtk after 254380@main
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247359

Reviewed by Michael Catanzaro.

We need to do the same changes done in 254380@main for DragDataGtk.

* Source/WebCore/platform/gtk/DragDataGtk.cpp:
(WebCore::DragData::containsFiles const):
(WebCore::DragData::numberOfFiles const):
(WebCore::DragData::asFilenames const):

Canonical link: https://commits.webkit.org/256232@main
  • Loading branch information
carlosgcampos committed Nov 2, 2022
1 parent 22987c3 commit 0d05bac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/WebCore/platform/gtk/DragDataGtk.cpp
@@ -1,4 +1,6 @@
/*
* Copyright (C) 2016 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
Expand Down Expand Up @@ -33,16 +35,18 @@ bool DragData::containsColor() const

bool DragData::containsFiles() const
{
return m_platformDragData->hasFilenames();
return !m_disallowFileAccess && m_platformDragData->hasFilenames();
}

unsigned DragData::numberOfFiles() const
{
return m_platformDragData->filenames().size();
return !m_disallowFileAccess ? m_platformDragData->filenames().size() : 0;
}

Vector<String> DragData::asFilenames() const
{
if (m_disallowFileAccess)
return { };
return m_platformDragData->filenames();
}

Expand Down

0 comments on commit 0d05bac

Please sign in to comment.