Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Unified Diff: third_party/WebKit/Source/core/html/HTMLObjectElement.cpp

Issue 2434873003: Fix <object data=> YouTube Flash rewrites. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/flash_embeds.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
index 4307380b29bc6ae8a3dca2b4d12036d590c748d6..d6a0040456c00978d8197feb543526418b925c06 100644
--- a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
@@ -33,12 +33,14 @@
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/fetch/ImageResource.h"
+#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLImageLoader.h"
#include "core/html/HTMLMetaElement.h"
#include "core/html/HTMLParamElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/api/LayoutEmbeddedItem.h"
+#include "core/loader/FrameLoaderClient.h"
#include "core/plugins/PluginView.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/Widget.h"
@@ -313,6 +315,15 @@ void HTMLObjectElement::updateWidgetInternal() {
if (!layoutObject())
return;
+ // Overwrites the URL and MIME type of a Flash embed to use an HTML5 embed.
+ KURL overridenUrl =
+ document().frame()->loader().client()->overrideFlashEmbedWithHTML(
+ document().completeURL(m_url));
+ if (!overridenUrl.isEmpty()) {
+ url = m_url = overridenUrl.getString();
+ serviceType = m_serviceType = "text/html";
+ }
+
if (!hasValidClassId() ||
!requestObject(url, serviceType, paramNames, paramValues)) {
if (!url.isEmpty())
« no previous file with comments | « chrome/test/data/flash_embeds.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698