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

Unified Diff: third_party/WebKit/Source/web/WebNode.cpp

Issue 1977633003: Remove RenderFrameImpl::GetFocusedElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes the right click + blur + copy case. Created 4 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
Index: third_party/WebKit/Source/web/WebNode.cpp
diff --git a/third_party/WebKit/Source/web/WebNode.cpp b/third_party/WebKit/Source/web/WebNode.cpp
index ae7e0720f14e800942fdde70ae7fb58048532ea9..f25d8099ed2f8a7e253b4eceb99cc346b474b2f3 100644
--- a/third_party/WebKit/Source/web/WebNode.cpp
+++ b/third_party/WebKit/Source/web/WebNode.cpp
@@ -217,20 +217,27 @@ bool WebNode::focused() const
return m_private->focused();
}
-WebPluginContainer* WebNode::pluginContainer() const
+WebPluginContainer* WebNode::pluginContainerFromNode(const Node* node)
{
- if (isNull())
- return 0;
- const Node& coreNode = *constUnwrap<Node>();
- if (isHTMLObjectElement(coreNode) || isHTMLEmbedElement(coreNode)) {
- LayoutObject* object = coreNode.layoutObject();
- if (object && object->isLayoutPart()) {
- Widget* widget = toLayoutPart(object)->widget();
- if (widget && widget->isPluginContainer())
- return toWebPluginContainerImpl(widget);
- }
+ if (!node)
+ return nullptr;
+
+ if (!isHTMLObjectElement(node) && !isHTMLEmbedElement(node))
+ return nullptr;
+
+ LayoutObject* object = node->layoutObject();
+ if (object && object->isLayoutPart()) {
+ Widget* widget = toLayoutPart(object)->widget();
+ if (widget && widget->isPluginContainer())
+ return toWebPluginContainerImpl(widget);
}
- return 0;
+
+ return nullptr;
+}
+
+WebPluginContainer* WebNode::pluginContainer() const
+{
+ return pluginContainerFromNode(constUnwrap<Node>());
}
WebAXObject WebNode::accessibilityObject()
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698