| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) | 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "core/html/HTMLViewSourceDocument.h" | 48 #include "core/html/HTMLViewSourceDocument.h" |
| 49 #include "core/html/ImageDocument.h" | 49 #include "core/html/ImageDocument.h" |
| 50 #include "core/html/MediaDocument.h" | 50 #include "core/html/MediaDocument.h" |
| 51 #include "core/html/PluginDocument.h" | 51 #include "core/html/PluginDocument.h" |
| 52 #include "core/html/TextDocument.h" | 52 #include "core/html/TextDocument.h" |
| 53 #include "core/loader/FrameLoader.h" | 53 #include "core/loader/FrameLoader.h" |
| 54 #include "core/page/Page.h" | 54 #include "core/page/Page.h" |
| 55 #include "platform/ContentType.h" | 55 #include "platform/ContentType.h" |
| 56 #include "platform/MIMETypeRegistry.h" | 56 #include "platform/MIMETypeRegistry.h" |
| 57 #include "platform/graphics/Image.h" | 57 #include "platform/graphics/Image.h" |
| 58 #include "platform/graphics/media/MediaPlayer.h" | |
| 59 #include "platform/plugins/PluginData.h" | 58 #include "platform/plugins/PluginData.h" |
| 60 #include "platform/weborigin/SecurityOrigin.h" | 59 #include "platform/weborigin/SecurityOrigin.h" |
| 61 #include "wtf/StdLibExtras.h" | 60 #include "wtf/StdLibExtras.h" |
| 62 | 61 |
| 63 namespace blink { | 62 namespace blink { |
| 64 | 63 |
| 65 typedef HashSet<String, CaseFoldingHash> FeatureSet; | 64 typedef HashSet<String, CaseFoldingHash> FeatureSet; |
| 66 | 65 |
| 67 static void addString(FeatureSet& set, const char* string) | 66 static void addString(FeatureSet& set, const char* string) |
| 68 { | 67 { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) | 348 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug
ins(NotAboutToInstantiatePlugin)) |
| 350 pluginData = init.frame()->page()->pluginData(); | 349 pluginData = init.frame()->page()->pluginData(); |
| 351 | 350 |
| 352 // PDF is one image type for which a plugin can override built-in support. | 351 // PDF is one image type for which a plugin can override built-in support. |
| 353 // We do not want QuickTime to take over all image types, obviously. | 352 // We do not want QuickTime to take over all image types, obviously. |
| 354 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) | 353 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi
nData->supportsMimeType(type)) |
| 355 return PluginDocument::create(init); | 354 return PluginDocument::create(init); |
| 356 if (Image::supportsType(type)) | 355 if (Image::supportsType(type)) |
| 357 return ImageDocument::create(init); | 356 return ImageDocument::create(init); |
| 358 | 357 |
| 359 // Check to see if the type can be played by our MediaPlayer, if so create a
MediaDocument | 358 // Check to see if the type can be played by our media player, if so create
a MediaDocument |
| 360 if (HTMLMediaElement::supportsType(ContentType(type))) | 359 if (HTMLMediaElement::supportsType(ContentType(type))) |
| 361 return MediaDocument::create(init); | 360 return MediaDocument::create(init); |
| 362 | 361 |
| 363 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. | 362 // Everything else except text/plain can be overridden by plugins. In partic
ular, Adobe SVG Viewer should be used for SVG, if installed. |
| 364 // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a
fundamental type that the browser is expected to handle, | 363 // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a
fundamental type that the browser is expected to handle, |
| 365 // and also serves as an optimization to prevent loading the plug-in databas
e in the common case. | 364 // and also serves as an optimization to prevent loading the plug-in databas
e in the common case. |
| 366 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) | 365 if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type)
) |
| 367 return PluginDocument::create(init); | 366 return PluginDocument::create(init); |
| 368 if (isTextMIMEType(type)) | 367 if (isTextMIMEType(type)) |
| 369 return TextDocument::create(init); | 368 return TextDocument::create(init); |
| 370 if (type == "image/svg+xml") | 369 if (type == "image/svg+xml") |
| 371 return XMLDocument::createSVG(init); | 370 return XMLDocument::createSVG(init); |
| 372 if (isXMLMIMEType(type)) | 371 if (isXMLMIMEType(type)) |
| 373 return XMLDocument::create(init); | 372 return XMLDocument::create(init); |
| 374 | 373 |
| 375 return HTMLDocument::create(init); | 374 return HTMLDocument::create(init); |
| 376 } | 375 } |
| 377 | 376 |
| 378 void DOMImplementation::trace(Visitor* visitor) | 377 void DOMImplementation::trace(Visitor* visitor) |
| 379 { | 378 { |
| 380 visitor->trace(m_document); | 379 visitor->trace(m_document); |
| 381 } | 380 } |
| 382 | 381 |
| 383 } | 382 } |
| OLD | NEW |