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

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

Issue 7006010: Change InfoBar-related notifications to be sourced from a TabContentsWrapper, not a TabContents. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/tab_contents/infobar_container.cc
===================================================================
--- chrome/browser/tab_contents/infobar_container.cc (revision 87366)
+++ chrome/browser/tab_contents/infobar_container.cc (working copy)
@@ -43,7 +43,7 @@
tab_contents_ = contents;
if (tab_contents_) {
- Source<TabContents> tc_source(tab_contents_->tab_contents());
+ Source<TabContentsWrapper> tc_source(tab_contents_);
registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_ADDED,
tc_source);
registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED,
@@ -123,21 +123,21 @@
const NotificationDetails& details) {
switch (type.value) {
case NotificationType::TAB_CONTENTS_INFOBAR_ADDED:
- AddInfoBar(
- Details<InfoBarDelegate>(details)->CreateInfoBar(tab_contents_), true,
- WANT_CALLBACK);
+ AddInfoBar(Details<InfoBar>(details).ptr(), true, WANT_CALLBACK);
break;
- case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED:
- RemoveInfoBar(Details<InfoBarDelegate>(details).ptr(), true);
+ case NotificationType::TAB_CONTENTS_INFOBAR_REMOVED: {
+ typedef std::pair<InfoBarDelegate*, bool> RemoveDetails;
+ RemoveDetails* remove_details = Details<RemoveDetails>(details).ptr();
+ RemoveInfoBar(remove_details->first, remove_details->second);
break;
+ }
case NotificationType::TAB_CONTENTS_INFOBAR_REPLACED: {
- typedef std::pair<InfoBarDelegate*, InfoBarDelegate*> InfoBarPair;
- InfoBarPair* infobar_pair = Details<InfoBarPair>(details).ptr();
- RemoveInfoBar(infobar_pair->first, false);
- AddInfoBar(infobar_pair->second->CreateInfoBar(tab_contents_), false,
- WANT_CALLBACK);
+ typedef std::pair<InfoBarDelegate*, InfoBar*> ReplaceDetails;
+ ReplaceDetails* replace_details = Details<ReplaceDetails>(details).ptr();
+ RemoveInfoBar(replace_details->first, false);
+ AddInfoBar(replace_details->second, false, WANT_CALLBACK);
break;
}

Powered by Google App Engine
This is Rietveld 408576698