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

Unified Diff: trunk/src/chrome/browser/extensions/theme_installed_infobar_delegate.cc

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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: trunk/src/chrome/browser/extensions/theme_installed_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/extensions/theme_installed_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/extensions/theme_installed_infobar_delegate.cc (working copy)
@@ -9,7 +9,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
@@ -48,17 +47,16 @@
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile);
- scoped_ptr<InfoBar> new_infobar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(new ThemeInstalledInfoBarDelegate(
- profile->GetExtensionService(), theme_service, new_theme,
- previous_theme_id, previous_using_native_theme))));
+ scoped_ptr<InfoBarDelegate> new_infobar(new ThemeInstalledInfoBarDelegate(
+ infobar_service, profile->GetExtensionService(), theme_service, new_theme,
+ previous_theme_id, previous_using_native_theme));
// If there's a previous theme infobar, just replace that instead of adding a
// new one.
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
- InfoBar* old_infobar = infobar_service->infobar_at(i);
+ InfoBarDelegate* old_infobar = infobar_service->infobar_at(i);
ThemeInstalledInfoBarDelegate* theme_infobar =
- old_infobar->delegate()->AsThemePreviewInfobarDelegate();
+ old_infobar->AsThemePreviewInfobarDelegate();
if (theme_infobar) {
// If the user installed the same theme twice, ignore the second install
// and keep the first install info bar, so that they can easily undo to
@@ -77,12 +75,13 @@
}
ThemeInstalledInfoBarDelegate::ThemeInstalledInfoBarDelegate(
+ InfoBarService* infobar_service,
ExtensionService* extension_service,
ThemeService* theme_service,
const extensions::Extension* new_theme,
const std::string& previous_theme_id,
bool previous_using_native_theme)
- : ConfirmInfoBarDelegate(),
+ : ConfirmInfoBarDelegate(infobar_service),
extension_service_(extension_service),
theme_service_(theme_service),
name_(new_theme->name()),
@@ -155,5 +154,5 @@
// If the new theme is different from what this info bar is associated with,
// close this info bar since it is no longer relevant.
if (theme_id_ != theme_service_->GetThemeID())
- infobar()->RemoveSelf();
+ RemoveSelf();
}

Powered by Google App Engine
This is Rietveld 408576698