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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2888203006: Move the logic to retrieve the WebPluginContainer to LocalFrame and Node. (Closed)
Patch Set: Rename & format. 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
Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 404cbce7edeae5b552ab277f169a24e59853fa1c..d99f0bbeebbeae536920b7746eed6dfb94da8d86 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -55,6 +55,7 @@
#include "core/frame/VisualViewport.h"
#include "core/html/HTMLFrameElementBase.h"
#include "core/html/HTMLPlugInElement.h"
+#include "core/html/PluginDocument.h"
#include "core/input/EventHandler.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/layout/HitTestResult.h"
@@ -74,6 +75,7 @@
#include "core/paint/PaintLayer.h"
#include "core/paint/PaintLayerPainter.h"
#include "core/paint/TransformRecorder.h"
+#include "core/plugins/PluginView.h"
#include "core/probe/CoreProbes.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/timing/Performance.h"
@@ -975,4 +977,21 @@ std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() {
return Client()->CreateURLLoader();
}
+WebPluginContainerBase* LocalFrame::GetWebPluginContainerBase(
+ Node* node) const {
+ if (GetDocument() && GetDocument()->IsPluginDocument()) {
+ PluginDocument* plugin_document = ToPluginDocument(GetDocument());
+ return plugin_document->GetPluginView()->GetWebPluginContainerBase();
+ }
+ if (!node) {
+ DCHECK(GetDocument());
+ node = GetDocument()->FocusedElement();
+ }
+
+ if (node) {
+ return node->GetWebPluginContainerBase();
+ }
+ return nullptr;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698