コード例 #1
0
// extensions beyond IE's API
Vector<String> DataTransfer::types() const {
  Vector<String> types;
  if (!canReadTypes())
    return types;

  return m_dataObject->types();
}
コード例 #2
0
bool DataTransfer::hasStringOfType(const String& type) const
{
    if (!canReadTypes())
        return false;

    return types().contains(type);
}
コード例 #3
0
ファイル: Clipboard.cpp プロジェクト: Drakey83/steamlink-sdk
bool Clipboard::hasStringOfType(const String& type) const
{
    if (!canReadTypes())
        return false;

    return types().contains(type);
}
コード例 #4
0
Vector<String> DataTransfer::types() const
{
    // FIXME: Per HTML5, types should be a live array, and the DOM attribute should always return the same object.

    if (!canReadTypes())
        return Vector<String>();

    return m_pasteboard->types();
}
コード例 #5
0
// extensions beyond IE's API
Vector<String> DataTransfer::types() const
{
    Vector<String> types;
    if (!canReadTypes())
        return types;

    ListHashSet<String> typesSet = m_dataObject->types();
    types.appendRange(typesSet.begin(), typesSet.end());
    return types;
}
コード例 #6
0
bool DataTransfer::hasFileOfType(const String& type)
{
    ASSERT_WITH_SECURITY_IMPLICATION(canReadTypes());

    for (const String& path : m_pasteboard->readFilenames()) {
        if (equalIgnoringASCIICase(File::contentTypeForFile(path), type))
            return true;
    }

    return false;
}
コード例 #7
0
void DataTransfer::setDropEffect(const String &effect)
{
    if (!isForDragAndDrop())
        return;

    // The attribute must ignore any attempts to set it to a value other than none, copy, link, and move.
    if (effect != "none" && effect != "copy"  && effect != "link" && effect != "move")
        return;

    // FIXME: The spec actually allows this in all circumstances, even though there's no point in
    // setting the drop effect when this condition is not true.
    if (canReadTypes())
        m_dropEffect = effect;
}
コード例 #8
0
bool DataTransfer::hasFileOfType(const String& type) const {
  if (!canReadTypes())
    return false;

  FileList* fileList = files();
  if (fileList->isEmpty())
    return false;

  for (unsigned f = 0; f < fileList->length(); f++) {
    if (equalIgnoringCase(fileList->item(f)->type(), type))
      return true;
  }
  return false;
}
コード例 #9
0
void DataTransfer::setDropEffect(const String& effect)
{
    if (!m_forDrag)
        return;

    if (effect != "none" && effect != "copy" && effect != "link" && effect != "move")
        return;

    // FIXME: The spec allows this in all circumstances. There is probably no value
    // in ignoring attempts to change it.
    if (!canReadTypes())
        return;

    m_dropEffect = effect;
}
コード例 #10
0
ファイル: Clipboard.cpp プロジェクト: Drakey83/steamlink-sdk
bool Clipboard::hasFileOfType(const String& type) const
{
    if (!canReadTypes())
        return false;

    RefPtrWillBeRawPtr<FileList> fileList = files();
    if (fileList->isEmpty())
        return false;

    for (unsigned f = 0; f < fileList->length(); f++) {
        if (equalIgnoringCase(fileList->item(f)->type(), type))
            return true;
    }
    return false;
}
コード例 #11
0
bool DataTransfer::hasStringOfType(const String& type)
{
    ASSERT_WITH_SECURITY_IMPLICATION(canReadTypes());

    return !type.isNull() && types().contains(type);
}