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

Unified Diff: chrome/browser/extensions/extension_install_ui.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 | « no previous file | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_ui.cc
===================================================================
--- chrome/browser/extensions/extension_install_ui.cc (revision 23152)
+++ chrome/browser/extensions/extension_install_ui.cc (working copy)
@@ -110,16 +110,22 @@
if (!tab_contents)
return;
- // First remove any previous theme preview infobar.
+ // First find any previous theme preview infobars.
+ InfoBarDelegate* old_delegate = NULL;
for (int i = 0; i < tab_contents->infobar_delegate_count(); ++i) {
InfoBarDelegate* delegate = tab_contents->GetInfoBarDelegateAt(i);
if (delegate->AsThemePreviewInfobarDelegate()) {
- tab_contents->RemoveInfoBar(delegate);
+ old_delegate = delegate;
break;
}
}
- // Now add the new one.
- tab_contents->AddInfoBar(new ThemePreviewInfobarDelegate(
- tab_contents, extension->name()));
+ // Then either replace that old one or add a new one.
+ InfoBarDelegate* new_delegate = new ThemePreviewInfobarDelegate(tab_contents,
+ extension->name());
+
+ if (old_delegate)
+ tab_contents->ReplaceInfoBar(old_delegate, new_delegate);
+ else
+ tab_contents->AddInfoBar(new_delegate);
}
Property changes on: chrome\browser\extensions\extension_install_ui.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/extensions/extension_install_ui.cc:r22711
« no previous file with comments | « no previous file | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698