bool EditorClientImpl::canPaste(Frame* frame, bool defaultValue) const
{
    WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
    if (!webFrame->permissionClient())
        return defaultValue;
    return webFrame->permissionClient()->allowReadFromClipboard(webFrame, defaultValue);
}
bool EditorClientImpl::canCopyCut(Frame* frame, bool defaultValue) const
{
    WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
    if (!webFrame->permissionClient())
        return defaultValue;
    return webFrame->permissionClient()->allowWriteToClipboard(webFrame, defaultValue);
}
示例#3
0
bool DatabaseClientImpl::allowDatabase(ExecutionContext* executionContext, const String& name, const String& displayName, unsigned long estimatedSize)
{
    ASSERT(executionContext->isContextThread());
    ASSERT(executionContext->isDocument() || executionContext->isWorkerGlobalScope());
    if (executionContext->isDocument()) {
        Document* document = toDocument(executionContext);
        WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
        if (!webFrame)
            return false;
        if (webFrame->permissionClient())
            return webFrame->permissionClient()->allowDatabase(webFrame, name, displayName, estimatedSize);
    } else {
        WorkerGlobalScope& workerGlobalScope = *toWorkerGlobalScope(executionContext);
        return WorkerPermissionClient::from(workerGlobalScope)->allowDatabase(name, displayName, estimatedSize);
    }
    return true;
}