diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 22:29:31 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 22:29:31 +0000 |
commit | 271ff579de76e1faf48978d9f3196c7eecc04323 (patch) | |
tree | 58c0e5b87faebae99524267a75db8121d8630c51 /components/plugins | |
parent | 6b7063e56a2da082be1782d4accf419265890bb4 (diff) | |
download | chromium_src-271ff579de76e1faf48978d9f3196c7eecc04323.zip chromium_src-271ff579de76e1faf48978d9f3196c7eecc04323.tar.gz chromium_src-271ff579de76e1faf48978d9f3196c7eecc04323.tar.bz2 |
Switch plugin creation to use RenderFrame instead of RenderView
BUG=245126
R=bauerb@chromium.org, nasko@chromium.org
Review URL: https://codereview.chromium.org/104973002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/plugins')
4 files changed, 18 insertions, 4 deletions
diff --git a/components/plugins/renderer/mobile_youtube_plugin.cc b/components/plugins/renderer/mobile_youtube_plugin.cc index e2f5793..9c9f7a4 100644 --- a/components/plugins/renderer/mobile_youtube_plugin.cc +++ b/components/plugins/renderer/mobile_youtube_plugin.cc @@ -71,11 +71,13 @@ bool IsValidYouTubeVideo(const std::string& path) { namespace plugins { MobileYouTubePlugin::MobileYouTubePlugin(content::RenderView* render_view, + content::RenderFrame* render_frame, blink::WebFrame* frame, const blink::WebPluginParams& params, base::StringPiece& template_html, GURL placeholderDataUrl) : PluginPlaceholder(render_view, + render_frame, frame, params, HtmlData(params, template_html), diff --git a/components/plugins/renderer/mobile_youtube_plugin.h b/components/plugins/renderer/mobile_youtube_plugin.h index 80a4f99..bec6fd4 100644 --- a/components/plugins/renderer/mobile_youtube_plugin.h +++ b/components/plugins/renderer/mobile_youtube_plugin.h @@ -17,6 +17,7 @@ namespace plugins { class MobileYouTubePlugin : public PluginPlaceholder { public: MobileYouTubePlugin(content::RenderView* render_view, + content::RenderFrame* render_frame, blink::WebFrame* frame, const blink::WebPluginParams& params, base::StringPiece& template_html, diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc index 671d2e0..b4b725b 100644 --- a/components/plugins/renderer/plugin_placeholder.cc +++ b/components/plugins/renderer/plugin_placeholder.cc @@ -13,6 +13,7 @@ #include "base/values.h" #include "content/public/common/content_constants.h" #include "content/public/common/context_menu_params.h" +#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" #include "third_party/WebKit/public/web/WebDocument.h" @@ -41,11 +42,13 @@ using webkit_glue::CppVariant; namespace plugins { PluginPlaceholder::PluginPlaceholder(content::RenderView* render_view, + content::RenderFrame* render_frame, WebFrame* frame, const WebPluginParams& params, const std::string& html_data, GURL placeholderDataUrl) : content::RenderViewObserver(render_view), + render_frame_(render_frame), frame_(frame), plugin_params_(params), plugin_(WebViewPlugin::Create(this, @@ -203,7 +206,7 @@ void PluginPlaceholder::LoadPlugin() { // ChromeContentRendererClient::CreatePlugin instead, to // reduce the chance of future regressions. WebPlugin* plugin = - render_view()->CreatePlugin(frame_, plugin_info_, plugin_params_); + render_frame_->CreatePlugin(frame_, plugin_info_, plugin_params_); ReplacePlugin(plugin); } @@ -239,6 +242,10 @@ void PluginPlaceholder::SetIdentifier(const std::string& identifier) { identifier_ = identifier; } +content::RenderFrame* PluginPlaceholder::GetRenderFrame() { + return render_frame_; +} + blink::WebFrame* PluginPlaceholder::GetFrame() { return frame_; } const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const { diff --git a/components/plugins/renderer/plugin_placeholder.h b/components/plugins/renderer/plugin_placeholder.h index 2fa6116..19d8c14 100644 --- a/components/plugins/renderer/plugin_placeholder.h +++ b/components/plugins/renderer/plugin_placeholder.h @@ -14,6 +14,7 @@ #include "webkit/renderer/cpp_bound_class.h" namespace content { +class RenderFrame; struct WebPluginInfo; } @@ -34,9 +35,10 @@ class PluginPlaceholder : public content::RenderViewObserver, void set_allow_loading(bool allow_loading) { allow_loading_ = allow_loading; } protected: - // |render_view| and |frame| are weak pointers. If either one is going away, - // our |plugin_| will be destroyed as well and will notify us. - PluginPlaceholder(content::RenderView* render_view, + // |render_view|, |render_frame| and |frame| are weak pointers. If either one + // is going away, our |plugin_| will be destroyed as well and will notify us. + PluginPlaceholder(content::RenderView* render_view, // TODO(jam): remove me + content::RenderFrame* render_frame, blink::WebFrame* frame, const blink::WebPluginParams& params, const std::string& html_data, @@ -51,6 +53,7 @@ class PluginPlaceholder : public content::RenderViewObserver, void SetPluginInfo(const content::WebPluginInfo& plugin_info); const content::WebPluginInfo& GetPluginInfo() const; void SetIdentifier(const std::string& identifier); + content::RenderFrame* GetRenderFrame(); blink::WebFrame* GetFrame(); const blink::WebPluginParams& GetPluginParams() const; bool LoadingAllowed() const { return allow_loading_; } @@ -90,6 +93,7 @@ class PluginPlaceholder : public content::RenderViewObserver, void UpdateMessage(); + content::RenderFrame* render_frame_; blink::WebFrame* frame_; blink::WebPluginParams plugin_params_; WebViewPlugin* plugin_; |