diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 21:00:49 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 21:00:49 +0000 |
commit | 51ffaf742c78f2fdd9833167c5534d8009873751 (patch) | |
tree | acad7cf4038f246d01dd5852050cac7bd67b5aaf /chrome/renderer/plugins | |
parent | aaaab841d2e79745eb9e24ad873237509557fb53 (diff) | |
download | chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.zip chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.tar.gz chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.tar.bz2 |
Load only blocked plug-ins when allowing plug-ins from infobars.
BUG=126418
TEST=see bug for manual test
Review URL: https://chromiumcodereview.appspot.com/10384038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/plugins')
-rw-r--r-- | chrome/renderer/plugins/plugin_placeholder.cc | 7 | ||||
-rw-r--r-- | chrome/renderer/plugins/plugin_placeholder.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chrome/renderer/plugins/plugin_placeholder.cc b/chrome/renderer/plugins/plugin_placeholder.cc index 842dc28..e87bbea 100644 --- a/chrome/renderer/plugins/plugin_placeholder.cc +++ b/chrome/renderer/plugins/plugin_placeholder.cc @@ -150,6 +150,7 @@ PluginPlaceholder* PluginPlaceholder::CreateBlockedPlugin( WebFrame* frame, const WebPluginParams& params, const WebPluginInfo& plugin, + const std::string& identifier, const string16& name, int template_id, int message_id) { @@ -172,6 +173,7 @@ PluginPlaceholder* PluginPlaceholder::CreateBlockedPlugin( PluginPlaceholder* blocked_plugin = new PluginPlaceholder( render_view, frame, params, html_data, name); blocked_plugin->plugin_info_ = plugin; + blocked_plugin->identifier_ = identifier; return blocked_plugin; } @@ -523,7 +525,10 @@ void PluginPlaceholder::ShowContextMenu(const WebMouseEvent& event) { g_last_active_menu = this; } -void PluginPlaceholder::OnLoadBlockedPlugins() { +void PluginPlaceholder::OnLoadBlockedPlugins(const std::string& identifier) { + if (!identifier.empty() && identifier != identifier_) + return; + RenderThread::Get()->RecordUserMetrics("Plugin_Load_UI"); LoadPlugin(); } diff --git a/chrome/renderer/plugins/plugin_placeholder.h b/chrome/renderer/plugins/plugin_placeholder.h index 561cd16..b2bea5e 100644 --- a/chrome/renderer/plugins/plugin_placeholder.h +++ b/chrome/renderer/plugins/plugin_placeholder.h @@ -44,6 +44,7 @@ class PluginPlaceholder : public content::RenderViewObserver, WebKit::WebFrame* frame, const WebKit::WebPluginParams& params, const webkit::WebPluginInfo& info, + const std::string& identifier, const string16& name, int resource_id, int message_id); @@ -131,7 +132,7 @@ class PluginPlaceholder : public content::RenderViewObserver, void DidFinishLoadingCallback(const webkit_glue::CppArgumentList& args, webkit_glue::CppVariant* result); - void OnLoadBlockedPlugins(); + void OnLoadBlockedPlugins(const std::string& identifier); void OnSetIsPrerendering(bool is_prerendering); void OnDidNotFindMissingPlugin(); #if defined(ENABLE_PLUGIN_INSTALLATION) @@ -181,6 +182,7 @@ class PluginPlaceholder : public content::RenderViewObserver, bool has_host_; bool finished_loading_; string16 plugin_name_; + std::string identifier_; DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder); }; |