Example #1
0
void FrameLoaderClient::dispatchWillSendRequest(WebCore::DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    GOwnPtr<WebKitNetworkResponse> networkResponse(0);

    // We are adding one more resource to the load, or maybe we are
    // just redirecting a load.
    if (redirectResponse.isNull())
        static_cast<WebKit::DocumentLoader*>(loader)->increaseLoadCount(identifier);
    else
        networkResponse.set(webkit_network_response_new_with_core_response(redirectResponse));

    WebKitWebView* webView = getViewFromFrame(m_frame);
    GOwnPtr<gchar> identifierString(toString(identifier));
    WebKitWebResource* webResource = webkit_web_view_get_resource(webView, identifierString.get());
    GOwnPtr<WebKitNetworkRequest> networkRequest(webkit_network_request_new_with_core_request(request));

    if (!redirectResponse.isNull()) {
        // This is a redirect, so we need to update the WebResource's knowledge
        // of the URI.
        g_free(webResource->priv->uri);
        webResource->priv->uri = g_strdup(request.url().string().utf8().data());
    }
    
    g_signal_emit_by_name(webView, "resource-request-starting", m_frame, webResource, networkRequest.get(), networkResponse.get());

    // Feed any changes back into the ResourceRequest object.
    SoupMessage* message = webkit_network_request_get_message(networkRequest.get());
    if (!message) {
        request.setURL(KURL(KURL(), String::fromUTF8(webkit_network_request_get_uri(networkRequest.get()))));
        return;
    }

    request.updateFromSoupMessage(message);
}
void FrameLoaderClient::dispatchDecidePolicyForResponse(FramePolicyFunction policyFunction, const ResourceResponse& response, const ResourceRequest& resourceRequest)
{
    ASSERT(policyFunction);
    if (!policyFunction)
        return;

    if (resourceRequest.isNull()) {
        (core(m_frame)->loader()->policyChecker()->*policyFunction)(PolicyIgnore);
        return;
    }

    WebKitWebView* page = getViewFromFrame(m_frame);
    GRefPtr<WebKitNetworkRequest> request(adoptGRef(kitNew(resourceRequest)));

    WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction);
    if (m_policyDecision)
        g_object_unref(m_policyDecision);
    m_policyDecision = policyDecision;

    String mimeType = response.mimeType();

    gboolean isHandled = false;
    g_signal_emit_by_name(page, "mime-type-policy-decision-requested", m_frame, request.get(), mimeType.utf8().data(), policyDecision, &isHandled);

    if (isHandled)
        return;

    GRefPtr<WebKitNetworkResponse> networkResponse(adoptGRef(webkit_web_frame_get_network_response(m_frame)));
    if (networkResponse) {
        ResourceResponse response = core(networkResponse.get());
        if (response.isAttachment()) {
            webkit_web_policy_decision_download(policyDecision);
            return;
        }
    }

    if (canShowMIMEType(mimeType))
        webkit_web_policy_decision_use(policyDecision);
    else
        webkit_web_policy_decision_ignore(policyDecision);
}
Example #3
0
taskFinder::taskFinder(QWidget *parent) : QWidget(parent){
        this->setStyleSheet("QTreeView::branch:has-siblings:!adjoins-item {"
                            "border-image: url(:img/stylesheet-vline.png) 0;"
        "}"
        "QTreeView::branch:has-siblings:adjoins-item {"
        " border-image: url(:img/stylesheet-branch-more.png) 0;"
        "}"

        "QTreeView::branch:!has-children:!has-siblings:adjoins-item {"
        "border-image: url(:img/stylesheet-branch-end.png) 0;"
        "}"

        "QTreeView::branch:has-children:!has-siblings:closed,"
        "QTreeView::branch:closed:has-children:has-siblings {"
                "border-image: none;"
                "image: url(:img/stylesheet-branch-closed.png);"
        "}"

        "QTreeView::branch:open:has-children:!has-siblings,"
        "QTreeView::branch:open:has-children:has-siblings  {"
                "border-image: none;"
                "image: url(:img/stylesheet-branch-open.png);"
        "}");

        this->reply=0;
        treeWidget = new QTreeWidget(this);
        treeWidget->setColumnCount(3);
        QStringList header;

        header<<"Title"<<"Owner"<<"Status";
        treeWidget->setHeaderLabels(header);
        treeWidget->setColumnWidth(0,500);
        layout = new QVBoxLayout();
        QToolBar *toolbar=new QToolBar(this);
        this->hideClosed = new QAction(this);
        hideClosed->setCheckable(true);
        hideClosed->setText("Hide Closed");
        hideClosed->setChecked(true);
        toolbar->addAction(hideClosed);
        toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
        layout->addWidget(toolbar);



        layout->addWidget(treeWidget);




        this->setLayout(layout);
        search();
        connect(treeWidget,SIGNAL(itemClicked(QTreeWidgetItem*,int)),this,SLOT(itemActivated(QTreeWidgetItem*,int)));
        connect(&static_cast <qtMushi *>(qApp)->taskDirectory,SIGNAL(updated()),this,SLOT(networkResponse()));
        connect(hideClosed,SIGNAL(toggled(bool)),this,SLOT(networkResponse()));
}