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

Unified Diff: webkit/plugins/npapi/webplugin_impl.cc

Issue 10093011: Show a replacement plug-in for loading errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 8 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
« no previous file with comments | « content/shell/shell_content_renderer_client.cc ('k') | webkit/plugins/npapi/webplugin_page_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/webplugin_impl.cc
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index f776559aa1b770a4b3e9f5ca0504edb7219485ba..723a7c03216fa1fdc59e0ef11f3f18a8899d33fd 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -256,10 +256,8 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
WebPluginDelegate* plugin_delegate = page_delegate_->CreatePluginDelegate(
file_path_, mime_type_);
- if (!plugin_delegate) {
- LOG(ERROR) << "Couldn't create plug-in delegate";
+ if (!plugin_delegate)
return false;
- }
// Set the container before Initialize because the plugin may
// synchronously call NPN_GetValue to get its container during its
@@ -270,7 +268,14 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
if (!ok) {
LOG(ERROR) << "Couldn't initialize plug-in";
plugin_delegate->PluginDestroyed();
- return false;
+
+ WebKit::WebPlugin* replacement_plugin =
+ page_delegate_->CreatePluginReplacement(file_path_);
+ if (!replacement_plugin || !replacement_plugin->initialize(container))
+ return false;
+
+ container->setPlugin(replacement_plugin);
+ return true;
}
delegate_ = plugin_delegate;
« no previous file with comments | « content/shell/shell_content_renderer_client.cc ('k') | webkit/plugins/npapi/webplugin_page_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698