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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2888203006: Move the logic to retrieve the WebPluginContainer to LocalFrame and Node. (Closed)
Patch Set: Ensure we have a valid PluginView before using it. Created 3 years, 7 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 | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 2c1b5bee29fb8df519818bd1fb51beae183a9303..dcdb71f0bed37739deb2b2c0e62b29da6c3c872e 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -90,8 +90,10 @@
#include "core/html/HTMLSlotElement.h"
#include "core/input/EventHandler.h"
#include "core/layout/LayoutBox.h"
+#include "core/layout/LayoutPart.h"
#include "core/page/ContextMenuController.h"
#include "core/page/Page.h"
+#include "core/plugins/PluginView.h"
#include "core/svg/SVGElement.h"
#include "core/svg/graphics/SVGImage.h"
#include "platform/EventDispatchForbiddenScope.h"
@@ -2579,6 +2581,22 @@ void Node::CheckSlotChange(SlotChangeType slot_change_type) {
}
}
+WebPluginContainerBase* Node::GetWebPluginContainerBase() const {
+ if (!isHTMLObjectElement(this) && !isHTMLEmbedElement(this)) {
+ return nullptr;
+ }
+
+ LayoutObject* object = GetLayoutObject();
+ if (object && object->IsLayoutPart()) {
+ PluginView* plugin = ToLayoutPart(object)->Plugin();
+ if (plugin) {
+ return plugin->GetWebPluginContainerBase();
+ }
+ }
+
+ return nullptr;
+}
+
DEFINE_TRACE(Node) {
visitor->Trace(parent_or_shadow_host_node_);
visitor->Trace(previous_);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698