summaryrefslogtreecommitdiffstats
path: root/components/plugins
diff options
context:
space:
mode:
authorlfg <lfg@chromium.org>2015-12-10 12:49:12 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-10 20:50:54 +0000
commitef517df9ab33928b03e81afbffb7b38a23b42767 (patch)
tree9478ed8485781595cecce81133710cd47d35ccae /components/plugins
parent667512ff414d2864a10a549ffba666342ce231c0 (diff)
downloadchromium_src-ef517df9ab33928b03e81afbffb7b38a23b42767.zip
chromium_src-ef517df9ab33928b03e81afbffb7b38a23b42767.tar.gz
chromium_src-ef517df9ab33928b03e81afbffb7b38a23b42767.tar.bz2
Create a WebFrameWidget for WebViewPlugin.
BUG=419087 Review URL: https://codereview.chromium.org/1512103002 Cr-Commit-Position: refs/heads/master@{#364468}
Diffstat (limited to 'components/plugins')
-rw-r--r--components/plugins/renderer/webview_plugin.cc10
-rw-r--r--components/plugins/renderer/webview_plugin.h4
2 files changed, 13 insertions, 1 deletions
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 5e185c1..c670751 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -17,6 +17,7 @@
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
+#include "third_party/WebKit/public/web/WebFrameWidget.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
@@ -26,6 +27,7 @@ using blink::WebCanvas;
using blink::WebCursorInfo;
using blink::WebDragData;
using blink::WebDragOperationsMask;
+using blink::WebFrameWidget;
using blink::WebImage;
using blink::WebInputEvent;
using blink::WebLocalFrame;
@@ -55,8 +57,13 @@ WebViewPlugin::WebViewPlugin(content::RenderView* render_view,
// ApplyWebPreferences before making a WebLocalFrame so that the frame sees a
// consistent view of our preferences.
content::RenderView::ApplyWebPreferences(preferences, web_view_);
- web_frame_ = WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
+ WebLocalFrame* web_local_frame =
+ WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
+ web_frame_ = web_local_frame;
web_view_->setMainFrame(web_frame_);
+ // TODO(dcheng): The main frame widget currently has a special case.
+ // Eliminate this once WebView is no longer a WebWidget.
+ web_frame_widget_ = WebFrameWidget::create(this, web_view_, web_local_frame);
}
// static
@@ -72,6 +79,7 @@ WebViewPlugin* WebViewPlugin::Create(content::RenderView* render_view,
}
WebViewPlugin::~WebViewPlugin() {
+ web_frame_widget_->close();
web_view_->close();
web_frame_->close();
}
diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h
index 74b4b1b..20fa038 100644
--- a/components/plugins/renderer/webview_plugin.h
+++ b/components/plugins/renderer/webview_plugin.h
@@ -19,6 +19,7 @@
#include "third_party/WebKit/public/web/WebViewClient.h"
namespace blink {
+class WebFrameWidget;
class WebMouseEvent;
}
@@ -166,6 +167,9 @@ class WebViewPlugin : public blink::WebPlugin,
blink::WebView* web_view_;
// Owned by us, deleted via |close()|.
+ blink::WebFrameWidget* web_frame_widget_;
+
+ // Owned by us, deleted via |close()|.
blink::WebFrame* web_frame_;
gfx::Rect rect_;