summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_observer.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 00:27:44 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 00:27:44 +0000
commit3fc07c5701fa6fdd4c7ed86b935458cece8eacf7 (patch)
tree0787f38f50add4a178358c1f910c3f3fad9fda36 /chrome/browser/plugin_observer.cc
parent4e87da9fcc4a9735c06b71314421651d020995ec (diff)
downloadchromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.zip
chromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.tar.gz
chromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.tar.bz2
Move CrashedPlugin() and PluginHungStatusChanged() from WebContentsDelegate into WebContentsObserver, and implement them in PluginObserver and HungPluginTabHelper.
This removes some code from Browser that only forwarded to other helpers. BUG=none TEST=none Review URL: http://codereview.chromium.org/10117025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_observer.cc')
-rw-r--r--chrome/browser/plugin_observer.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index f14605b..34a708d 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -15,10 +15,12 @@
#include "chrome/browser/plugin_infobar_delegates.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
+#include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -36,6 +38,7 @@
#endif // defined(ENABLE_PLUGIN_INSTALLATION)
using content::OpenURLParams;
+using content::PluginService;
using content::Referrer;
using content::WebContents;
@@ -169,6 +172,22 @@ PluginObserver::~PluginObserver() {
#endif
}
+void PluginObserver::PluginCrashed(const FilePath& plugin_path) {
+ DCHECK(!plugin_path.value().empty());
+
+ string16 plugin_name =
+ PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path);
+ gfx::Image* icon = &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
+ IDR_INFOBAR_PLUGIN_CRASHED);
+ InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper();
+ infobar_helper->AddInfoBar(
+ new SimpleAlertInfoBarDelegate(
+ infobar_helper,
+ icon,
+ l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
+ true));
+}
+
bool PluginObserver::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(PluginObserver, message)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin,