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

Unified Diff: chrome/browser/ui/browser.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/ui/autologin_infobar_delegate.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index c0d385a9bed86df7e9db7b09fd8b5ecf9f5b11f5..afa4beea859fe676373fe2b66bfbb33bd277bb29 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -51,6 +51,7 @@
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/google/google_util.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/instant_unload_handler.h"
#include "chrome/browser/intents/register_intent_handler_infobar_delegate.h"
@@ -2431,7 +2432,7 @@ void Browser::JSOutOfMemoryHelper(TabContents* tab) {
TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents(
tab);
if (tcw) {
- tcw->AddInfoBar(new SimpleAlertInfoBarDelegate(
+ tcw->infobar_tab_helper()->AddInfoBar(new SimpleAlertInfoBarDelegate(
tab, NULL, l10n_util::GetStringUTF16(IDS_JS_OUT_OF_MEMORY_PROMPT),
true));
}
@@ -2465,9 +2466,8 @@ void Browser::RegisterProtocolHandlerHelper(TabContents* tab,
registry->CanSchemeBeOverridden(handler.protocol())) {
UserMetrics::RecordAction(
UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown"));
- tcw->AddInfoBar(new RegisterProtocolHandlerInfoBarDelegate(tab,
- registry,
- handler));
+ tcw->infobar_tab_helper()->AddInfoBar(
+ new RegisterProtocolHandlerInfoBarDelegate(tab, registry, handler));
}
}
@@ -2496,7 +2496,8 @@ void Browser::RegisterIntentHandlerHelper(TabContents* tab,
intent.action = action;
intent.type = type;
intent.title = title;
- tcw->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate(tab, intent));
+ tcw->infobar_tab_helper()->AddInfoBar(
+ new RegisterIntentHandlerInfoBarDelegate(tab, intent));
}
// static
@@ -3701,7 +3702,7 @@ void Browser::RendererResponsive(TabContents* source) {
void Browser::WorkerCrashed(TabContents* source) {
TabContentsWrapper* wrapper =
TabContentsWrapper::GetCurrentWrapperForContents(source);
- wrapper->AddInfoBar(new SimpleAlertInfoBarDelegate(
+ wrapper->infobar_tab_helper()->AddInfoBar(new SimpleAlertInfoBarDelegate(
source, NULL, l10n_util::GetStringUTF16(IDS_WEBWORKER_CRASHED_PROMPT),
true));
}
« no previous file with comments | « chrome/browser/ui/autologin_infobar_delegate.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698