summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/npapi/webplugin_impl.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 14:49:01 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 14:49:01 +0000
commit6ac77cba804aeb102dcc636bed567c3bb7b48f5e (patch)
tree1071173db6b16e5fdff97c21823bb05a06668959 /webkit/plugins/npapi/webplugin_impl.cc
parenta7fb2513ba11ff13b20614f86bd372846a10dd2f (diff)
downloadchromium_src-6ac77cba804aeb102dcc636bed567c3bb7b48f5e.zip
chromium_src-6ac77cba804aeb102dcc636bed567c3bb7b48f5e.tar.gz
chromium_src-6ac77cba804aeb102dcc636bed567c3bb7b48f5e.tar.bz2
Show a replacement plug-in for loading errors.
This allows us to show a nicer placeholder when loading a plug-in fails then the one coming from WebKit. BUG=123580 TEST=manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=134620 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=134630 Review URL: http://codereview.chromium.org/10093011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/npapi/webplugin_impl.cc')
-rw-r--r--webkit/plugins/npapi/webplugin_impl.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index f776559..723a7c0 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;