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

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: fixes 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..7fe30151e720b15f77491dede50c0499d62f17b1 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"
@@ -261,11 +262,12 @@ void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper();
if (!tab_contents)
return;
+ InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper();
// 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 < infobar_helper->infobar_count(); ++i) {
+ InfoBarDelegate* delegate = infobar_helper->GetInfoBarDelegateAt(i);
ThemeInstalledInfoBarDelegate* theme_infobar =
delegate->AsThemePreviewInfobarDelegate();
if (theme_infobar) {
@@ -285,9 +287,9 @@ void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
previous_using_native_theme);
if (old_delegate)
- tab_contents->ReplaceInfoBar(old_delegate, new_delegate);
+ infobar_helper->ReplaceInfoBar(old_delegate, new_delegate);
else
- tab_contents->AddInfoBar(new_delegate);
+ infobar_helper->AddInfoBar(new_delegate);
}
void ExtensionInstallUI::ShowConfirmation(PromptType prompt_type) {
« no previous file with comments | « chrome/browser/extensions/extension_infobar_module.cc ('k') | chrome/browser/extensions/extension_install_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698