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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 890005: Add a command line flag to disable infobars. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/external_tab_container.cc ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 42751)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -955,6 +955,11 @@
}
void TabContents::AddInfoBar(InfoBarDelegate* delegate) {
+ if (delegate_ && !delegate_->infobars_enabled()) {
+ delegate->InfoBarClosed();
+ return;
+ }
+
// Look through the existing InfoBarDelegates we have for a match. If we've
// already got one that matches, then we don't add the new one.
for (int i = 0; i < infobar_delegate_count(); ++i) {
@@ -981,6 +986,10 @@
}
void TabContents::RemoveInfoBar(InfoBarDelegate* delegate) {
+ if (delegate_ && !delegate_->infobars_enabled()) {
+ return;
+ }
+
std::vector<InfoBarDelegate*>::iterator it =
find(infobar_delegates_.begin(), infobar_delegates_.end(), delegate);
if (it != infobar_delegates_.end()) {
@@ -1001,6 +1010,11 @@
void TabContents::ReplaceInfoBar(InfoBarDelegate* old_delegate,
InfoBarDelegate* new_delegate) {
+ if (delegate_ && !delegate_->infobars_enabled()) {
+ new_delegate->InfoBarClosed();
+ return;
+ }
+
std::vector<InfoBarDelegate*>::iterator it =
find(infobar_delegates_.begin(), infobar_delegates_.end(), old_delegate);
DCHECK(it != infobar_delegates_.end());
« no previous file with comments | « chrome/browser/external_tab_container.cc ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698