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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp

Issue 2154233003: Rewrite YouTube Flash embeds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 15 matching lines...) Expand all
26 #include "core/CSSPropertyNames.h" 26 #include "core/CSSPropertyNames.h"
27 #include "core/HTMLNames.h" 27 #include "core/HTMLNames.h"
28 #include "core/dom/Attribute.h" 28 #include "core/dom/Attribute.h"
29 #include "core/dom/ElementTraversal.h" 29 #include "core/dom/ElementTraversal.h"
30 #include "core/dom/shadow/ShadowRoot.h" 30 #include "core/dom/shadow/ShadowRoot.h"
31 #include "core/html/HTMLImageLoader.h" 31 #include "core/html/HTMLImageLoader.h"
32 #include "core/html/HTMLObjectElement.h" 32 #include "core/html/HTMLObjectElement.h"
33 #include "core/html/PluginDocument.h" 33 #include "core/html/PluginDocument.h"
34 #include "core/html/parser/HTMLParserIdioms.h" 34 #include "core/html/parser/HTMLParserIdioms.h"
35 #include "core/layout/LayoutPart.h" 35 #include "core/layout/LayoutPart.h"
36 #include "core/loader/FrameLoaderClient.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 using namespace HTMLNames; 40 using namespace HTMLNames;
40 41
41 inline HTMLEmbedElement::HTMLEmbedElement(Document& document, bool createdByPars er) 42 inline HTMLEmbedElement::HTMLEmbedElement(Document& document, bool createdByPars er)
42 : HTMLPlugInElement(embedTag, document, createdByParser, ShouldPreferPlugIns ForImages) 43 : HTMLPlugInElement(embedTag, document, createdByParser, ShouldPreferPlugIns ForImages)
43 { 44 {
44 } 45 }
45 46
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 140
140 // FIXME: These should be joined into a PluginParameters class. 141 // FIXME: These should be joined into a PluginParameters class.
141 Vector<String> paramNames; 142 Vector<String> paramNames;
142 Vector<String> paramValues; 143 Vector<String> paramValues;
143 parametersForPlugin(paramNames, paramValues); 144 parametersForPlugin(paramNames, paramValues);
144 145
145 // FIXME: Can we not have layoutObject here now that beforeload events are g one? 146 // FIXME: Can we not have layoutObject here now that beforeload events are g one?
146 if (!layoutObject()) 147 if (!layoutObject())
147 return; 148 return;
148 149
150 // Overwrites the URL and MIME type of a Flash embed to use an
151 // HTML5 video player when possible.
mlamouri (slow - plz ping) 2016/08/01 13:43:59 s/video player/embed/
kdsilva 2016/08/02 15:34:46 Done.
152 String overridenUrl = document().frame()->loader().client()->OverrideFlashEm bedWithHTML(document().completeURL(m_url));
153 if (overridenUrl != "") {
154 m_url = overridenUrl;
155 m_serviceType = "text/html";
156 }
157
149 requestObject(m_url, m_serviceType, paramNames, paramValues); 158 requestObject(m_url, m_serviceType, paramNames, paramValues);
150 } 159 }
151 160
152 bool HTMLEmbedElement::layoutObjectIsNeeded(const ComputedStyle& style) 161 bool HTMLEmbedElement::layoutObjectIsNeeded(const ComputedStyle& style)
153 { 162 {
154 if (isImageType()) 163 if (isImageType())
155 return HTMLPlugInElement::layoutObjectIsNeeded(style); 164 return HTMLPlugInElement::layoutObjectIsNeeded(style);
156 165
157 // https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-el ement 166 // https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-el ement
158 // While any of the following conditions are occurring, any plugin 167 // While any of the following conditions are occurring, any plugin
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 { 207 {
199 // http://www.whatwg.org/specs/web-apps/current-work/#exposed 208 // http://www.whatwg.org/specs/web-apps/current-work/#exposed
200 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor (*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) { 209 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor (*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) {
201 if (object->isExposed()) 210 if (object->isExposed())
202 return false; 211 return false;
203 } 212 }
204 return true; 213 return true;
205 } 214 }
206 215
207 } // namespace blink 216 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698