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

Unified Diff: webkit/plugins/ppapi/ppapi_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 | « webkit/plugins/ppapi/plugin_delegate.h ('k') | webkit/support/test_webplugin_page_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_webplugin_impl.cc
diff --git a/webkit/plugins/ppapi/ppapi_webplugin_impl.cc b/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
index fb0166217f54a830cb8e15b846286d0fc8b7e641..c5f9fe5913f0eecfb030b533c5381ba5cce328b4 100644
--- a/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
+++ b/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
@@ -27,6 +27,7 @@
using ppapi::NPObjectVar;
using WebKit::WebCanvas;
+using WebKit::WebPlugin;
using WebKit::WebPluginContainer;
using WebKit::WebPluginParams;
using WebKit::WebPoint;
@@ -84,7 +85,15 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
if (!success) {
instance_->Delete();
instance_ = NULL;
- return false;
+
+ WebKit::WebPlugin* replacement_plugin =
+ init_data_->delegate->CreatePluginReplacement(
+ init_data_->module->path());
+ if (!replacement_plugin || !replacement_plugin->initialize(container))
+ return false;
+
+ container->setPlugin(replacement_plugin);
+ return true;
}
init_data_.reset();
« no previous file with comments | « webkit/plugins/ppapi/plugin_delegate.h ('k') | webkit/support/test_webplugin_page_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698