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

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

Issue 165370: Merge 22711 - Fix a few bugs with the theme infobar:... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 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/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobar_container.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 23152)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -879,6 +879,28 @@
}
}
+void TabContents::ReplaceInfoBar(InfoBarDelegate* old_delegate,
+ InfoBarDelegate* new_delegate) {
+ std::vector<InfoBarDelegate*>::iterator it =
+ find(infobar_delegates_.begin(), infobar_delegates_.end(), old_delegate);
+ DCHECK(it != infobar_delegates_.end());
+
+ // Notify the container about the change of plans.
+ scoped_ptr<std::pair<InfoBarDelegate*, InfoBarDelegate*> > details(
+ new std::pair<InfoBarDelegate*, InfoBarDelegate*>(
+ old_delegate, new_delegate));
+ NotificationService::current()->Notify(
+ NotificationType::TAB_CONTENTS_INFOBAR_REPLACED,
+ Source<TabContents>(this),
+ Details<std::pair<InfoBarDelegate*, InfoBarDelegate*> >(details.get()));
+
+ // Remove the old one.
+ infobar_delegates_.erase(it);
+
+ // Add the new one.
+ infobar_delegates_.push_back(new_delegate);
+}
+
bool TabContents::IsBookmarkBarAlwaysVisible() {
// See GetDOMUIForCurrentState() comment for more info. This case is very
// similar, but for non-first loads, we want to use the committed entry. This
Property changes on: chrome\browser\tab_contents\tab_contents.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/tab_contents/tab_contents.cc:r22711
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobar_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698