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-01-13 21:40:05 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-13 21:40:05 +0000
commitdd840a3fabf0def317a186433dff7cb7be20ea72 (patch)
treec2a0f806007397b670e2387010d4b6164f66239e /chrome/browser/plugin_observer.cc
parent15438a027b0edc9c4eb0f9664374f276c148a7cd (diff)
downloadchromium_src-dd840a3fabf0def317a186433dff7cb7be20ea72.zip
chromium_src-dd840a3fabf0def317a186433dff7cb7be20ea72.tar.gz
chromium_src-dd840a3fabf0def317a186433dff7cb7be20ea72.tar.bz2
Check owner in PluginInstallerInfobarDelegate before removing itself.
Also, don't show the infobar if we're downloading the plug-in. BUG=110032 TEST=see bug for manual test Review URL: http://codereview.chromium.org/9188040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_observer.cc')
-rw-r--r--chrome/browser/plugin_observer.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
index 91f30f9..b2700b2 100644
--- a/chrome/browser/plugin_observer.cc
+++ b/chrome/browser/plugin_observer.cc
@@ -371,6 +371,7 @@ class PluginObserver::MissingPluginHost : public PluginInstallerObserver {
case PluginInstaller::kStateIdle: {
observer->Send(new ChromeViewMsg_FoundMissingPlugin(routing_id_,
installer->name()));
+ observer->ShowPluginInstallationInfoBar(installer);
break;
}
case PluginInstaller::kStateDownloading: {
@@ -453,15 +454,17 @@ void PluginObserver::FoundMissingPlugin(int placeholder_id,
PluginInstaller* installer) {
missing_plugins_.push_back(
new MissingPluginHost(this, placeholder_id, installer));
+}
+
+void PluginObserver::ShowPluginInstallationInfoBar(PluginInstaller* installer) {
InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper();
- PluginInstallerInfoBarDelegate* delegate = new PluginInstallerInfoBarDelegate(
+ infobar_helper->AddInfoBar(new PluginInstallerInfoBarDelegate(
installer,
infobar_helper,
installer->name(),
installer->help_url(),
base::Bind(&PluginObserver::InstallMissingPlugin,
- weak_ptr_factory_.GetWeakPtr(), installer));
- infobar_helper->AddInfoBar(delegate);
+ weak_ptr_factory_.GetWeakPtr(), installer)));
}
void PluginObserver::DidNotFindMissingPlugin(int placeholder_id) {