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

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: update 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ae0e665dcda73d2bf4059108334ce89eba2f62f1..129b74f01b46d83b764adf534402168a08655e51 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"
@@ -2426,7 +2427,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));
}
@@ -2460,9 +2461,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));
}
}
@@ -2491,7 +2491,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
@@ -3696,7 +3697,7 @@ void Browser::RendererResponsive(TabContents* source) {
void Browser::WorkerCrashed(TabContents* source) {
TabContentsWrapper* wrapper =
Peter Kasting 2011/08/31 18:47:32 Nit: Collapse these two lines together
TabContentsWrapper::GetCurrentWrapperForContents(source);
- wrapper->AddInfoBar(new SimpleAlertInfoBarDelegate(
+ wrapper->infobar_tab_helper()->AddInfoBar(new SimpleAlertInfoBarDelegate(
source, NULL, l10n_util::GetStringUTF16(IDS_WEBWORKER_CRASHED_PROMPT),
true));
}

Powered by Google App Engine
This is Rietveld 408576698