Commit 641fef90 authored by andersca@apple.com's avatar andersca@apple.com

2009-01-06 Anders Carlsson <andersca@apple.com>

        Reviewed by Sam Weinig.

        Add a way for frame loader clients to always create a PluginDocument, regardless of 
        the real document MIME type.
        
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::begin):
        (WebCore::FrameLoader::shouldUsePlugin):
        * loader/FrameLoaderClient.h:
        (WebCore::FrameLoaderClient::shouldUsePluginDocument):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 301b3b21
2009-01-06 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Add a way for frame loader clients to always create a PluginDocument, regardless of
the real document MIME type.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::begin):
(WebCore::FrameLoader::shouldUsePlugin):
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::shouldUsePluginDocument):
2009-01-06 Dean Jackson <dino@apple.com>
Reviewed by Dave Hyatt.
......@@ -72,6 +72,7 @@
#include "PageCache.h"
#include "PageGroup.h"
#include "PluginData.h"
#include "PluginDocument.h"
#include "ProgressTracker.h"
#include "RenderPart.h"
#include "RenderView.h"
......@@ -928,7 +929,12 @@ void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
m_outgoingReferrer = ref.string();
m_URL = url;
RefPtr<Document> document = DOMImplementation::createDocument(m_responseMIMEType, m_frame, m_frame->inViewSourceMode());
RefPtr<Document> document;
if (!m_isDisplayingInitialEmptyDocument && m_client->shouldUsePluginDocument(m_responseMIMEType))
document = PluginDocument::create(m_frame);
else
document = DOMImplementation::createDocument(m_responseMIMEType, m_frame, m_frame->inViewSourceMode());
m_frame->setDocument(document);
document->setURL(m_URL);
......@@ -1704,6 +1710,11 @@ bool FrameLoader::requestObject(RenderPart* renderer, const String& url, const A
bool FrameLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
{
if (m_client->shouldUsePluginDocument(mimeType)) {
useFallback = false;
return true;
}
// Allow other plug-ins to win over QuickTime because if the user has installed a plug-in that
// can handle TIFF (which QuickTime can also handle) they probably intended to override QT.
if (m_frame->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
......
......@@ -210,6 +210,8 @@ namespace WebCore {
virtual NSCachedURLResponse* willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse*) const = 0;
#endif
virtual bool shouldUsePluginDocument(const String& mimeType) const { return false; }
protected:
static void transitionToCommittedForNewPage(Frame*, const IntSize&, const Color&, bool, const IntSize &, bool,
ScrollbarMode = ScrollbarAuto, ScrollbarMode = ScrollbarAuto);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment