Esempio n. 1
0
void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
{
    WebPage* webPage = m_frame->page();
    bool isMainFrame = webPage->mainWebFrame() == m_frame;
    
    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
    m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
}
Esempio n. 2
0
void WebFrameLoaderClient::transitionToCommittedForNewPage()
{
    WebPage* webPage = m_frame->page();

    Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white;
    bool isMainFrame = webPage->mainWebFrame() == m_frame;
    bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();

#if !USE(TILED_BACKING_STORE)
    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
    m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
#endif

    m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
    m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
}
Esempio n. 3
0
PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
    ASSERT(paramNames.size() == paramValues.size());
    
    WebPage* webPage = m_frame->page();
    ASSERT(webPage);
    
    Plugin::Parameters parameters;
    parameters.url = url;
    parameters.names = paramNames;
    parameters.values = paramValues;
    parameters.mimeType = mimeType;
    parameters.loadManually = loadManually;
    parameters.documentURL = m_frame->coreFrame()->document()->url().string();

    Frame* mainFrame = webPage->mainWebFrame()->coreFrame();
    if (m_frame->coreFrame() == mainFrame)
        parameters.toplevelDocumentURL = parameters.documentURL;
    else if (m_frame->coreFrame()->document()->securityOrigin()->canAccess(mainFrame->document()->securityOrigin())) {
        // We only want to set the toplevel document URL if the plug-in has access to it.
        parameters.toplevelDocumentURL = mainFrame->document()->url().string();
    }

#if PLUGIN_ARCHITECTURE(X11)
    // FIXME: This should really be X11-specific plug-in quirks.
    if (equalIgnoringCase(mimeType, "application/x-shockwave-flash")) {
        // Currently we don't support transparency and windowed mode.
        // Inject wmode=opaque to make Flash work in these conditions.
        size_t wmodeIndex = parameters.names.find("wmode");
        if (wmodeIndex == notFound) {
            parameters.names.append("wmode");
            parameters.values.append("opaque");
        } else if (equalIgnoringCase(parameters.values[wmodeIndex], "window"))
            parameters.values[wmodeIndex] = "opaque";
    } else if (equalIgnoringCase(mimeType, "application/x-webkit-test-netscape")) {
        parameters.names.append("windowedPlugin");
        parameters.values.append("false");
    }
#endif

    RefPtr<Plugin> plugin = webPage->createPlugin(parameters);
    if (!plugin)
        return 0;
    
    return PluginView::create(pluginElement, plugin.release(), parameters);
}