本文整理汇总了C++中HTMLInputElement::acceptFileExtensions方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::acceptFileExtensions方法的具体用法?C++ HTMLInputElement::acceptFileExtensions怎么用?C++ HTMLInputElement::acceptFileExtensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLInputElement
的用法示例。
在下文中一共展示了HTMLInputElement::acceptFileExtensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleDOMActivateEvent
void FileInputType::handleDOMActivateEvent(Event* event)
{
if (element()->disabled())
return;
if (!ScriptController::processingUserGesture())
return;
if (Chrome* chrome = this->chrome()) {
FileChooserSettings settings;
HTMLInputElement* input = element();
#if ENABLE(DIRECTORY_UPLOAD)
settings.allowsDirectoryUpload = input->fastHasAttribute(webkitdirectoryAttr);
settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input->fastHasAttribute(multipleAttr);
#else
settings.allowsMultipleFiles = input->fastHasAttribute(multipleAttr);
#endif
settings.acceptMIMETypes = input->acceptMIMETypes();
settings.acceptFileExtensions = input->acceptFileExtensions();
settings.selectedFiles = m_fileList->paths();
#if ENABLE(MEDIA_CAPTURE)
settings.capture = input->capture();
#endif
chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
}
event->setDefaultHandled();
}
示例2: receiveDropForDirectoryUpload
void FileInputType::receiveDropForDirectoryUpload(const Vector<String>& paths)
{
if (Chrome* chrome = this->chrome()) {
FileChooserSettings settings;
HTMLInputElement* input = element();
settings.allowsDirectoryUpload = true;
settings.allowsMultipleFiles = true;
settings.selectedFiles.append(paths[0]);
settings.acceptMIMETypes = input->acceptMIMETypes();
settings.acceptFileExtensions = input->acceptFileExtensions();
chrome->enumerateChosenDirectory(newFileChooser(settings));
}
}