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

Unified Diff: chrome/browser/plugin_observer.cc

Issue 7810002: Move infobar handling to a tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 9 years, 4 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 | « chrome/browser/pdf_unsupported_feature.cc ('k') | chrome/browser/tab_contents/infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « chrome/browser/pdf_unsupported_feature.cc ('k') | chrome/browser/tab_contents/infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698