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

Unified Diff: chrome/browser/extensions/extension_install_ui.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/extensions/extension_install_ui.cc
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index d0b240d69ca7c932e24a64699f25e887ecb73ade..2b19f4a8cc070b62bc50085148ca6e6fd47dbc2f 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_install_dialog.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/simple_message_box.h"
#include "chrome/browser/tabs/tab_strip_model.h"
@@ -264,8 +265,11 @@ void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
// First find any previous theme preview infobars.
InfoBarDelegate* old_delegate = NULL;
- for (size_t i = 0; i < tab_contents->infobar_count(); ++i) {
- InfoBarDelegate* delegate = tab_contents->GetInfoBarDelegateAt(i);
+ for (size_t i = 0;
+ i < tab_contents->infobar_tab_helper()->infobar_count();
Peter Kasting 2011/08/31 18:47:32 Nit: Can you factor the infobar_tab_helper() out t
+ ++i) {
+ InfoBarDelegate* delegate =
+ tab_contents->infobar_tab_helper()->GetInfoBarDelegateAt(i);
ThemeInstalledInfoBarDelegate* theme_infobar =
delegate->AsThemePreviewInfobarDelegate();
if (theme_infobar) {
@@ -285,9 +289,10 @@ void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
previous_using_native_theme);
if (old_delegate)
- tab_contents->ReplaceInfoBar(old_delegate, new_delegate);
+ tab_contents->infobar_tab_helper()->ReplaceInfoBar(old_delegate,
+ new_delegate);
else
- tab_contents->AddInfoBar(new_delegate);
+ tab_contents->infobar_tab_helper()->AddInfoBar(new_delegate);
}
void ExtensionInstallUI::ShowConfirmation(PromptType prompt_type) {

Powered by Google App Engine
This is Rietveld 408576698