| Index: chrome/browser/plugin_observer.cc
|
| diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc
|
| index 4555ff88220f6f1e5309e923d73ec3483cdb2bc1..644a4f494db45177a2e37b98974103f94a4d575a 100644
|
| --- a/chrome/browser/plugin_observer.cc
|
| +++ b/chrome/browser/plugin_observer.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map.h"
|
| #include "chrome/browser/google/google_util.h"
|
| +#include "chrome/browser/infobars/infobar_tab_helper.h"
|
| #include "chrome/browser/plugin_installer_infobar_delegate.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
|
| @@ -313,18 +314,19 @@ PluginInstallerInfoBarDelegate* PluginObserver::GetPluginInstaller() {
|
| void PluginObserver::OnMissingPluginStatus(int status) {
|
| // TODO(PORT): pull in when plug-ins work
|
| #if defined(OS_WIN)
|
| + InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper();
|
| if (status == webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE) {
|
| - tab_contents_->AddInfoBar(
|
| + infobar_helper->AddInfoBar(
|
| new PluginInstallerInfoBarDelegate(tab_contents()));
|
| return;
|
| }
|
|
|
| DCHECK_EQ(webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD,
|
| status);
|
| - for (size_t i = 0; i < tab_contents_->infobar_count(); ++i) {
|
| - InfoBarDelegate* delegate = tab_contents_->GetInfoBarDelegateAt(i);
|
| + for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) {
|
| + InfoBarDelegate* delegate = infobar_helper->GetInfoBarDelegateAt(i);
|
| if (delegate->AsPluginInstallerInfoBarDelegate() != NULL) {
|
| - tab_contents_->RemoveInfoBar(delegate);
|
| + infobar_helper->RemoveInfoBar(delegate);
|
| return;
|
| }
|
| }
|
| @@ -350,15 +352,17 @@ void PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) {
|
| }
|
| gfx::Image* icon = &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
|
| IDR_INFOBAR_PLUGIN_CRASHED);
|
| - tab_contents_->AddInfoBar(new SimpleAlertInfoBarDelegate(tab_contents(),
|
| - icon,
|
| - l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
|
| - true));
|
| + tab_contents_->infobar_tab_helper()->AddInfoBar(
|
| + new SimpleAlertInfoBarDelegate(
|
| + tab_contents(),
|
| + icon,
|
| + l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
|
| + true));
|
| }
|
|
|
| void PluginObserver::OnBlockedOutdatedPlugin(const string16& name,
|
| const GURL& update_url) {
|
| - tab_contents_->AddInfoBar(update_url.is_empty() ?
|
| + tab_contents_->infobar_tab_helper()->AddInfoBar(update_url.is_empty() ?
|
| static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate(
|
| tab_contents(), name)) :
|
| new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url));
|
|
|