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

Unified Diff: chrome/browser/ui/extensions/extension_install_ui_default.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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: chrome/browser/ui/extensions/extension_install_ui_default.cc
===================================================================
--- chrome/browser/ui/extensions/extension_install_ui_default.cc (revision 238220)
+++ chrome/browser/ui/extensions/extension_install_ui_default.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
@@ -80,13 +81,13 @@
// Helper class to put up an infobar when installation fails.
class ErrorInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- // Creates an error infobar delegate and adds it to |infobar_service|.
+ // Creates an error infobar and delegate and adds the infobar to
+ // |infobar_service|.
static void Create(InfoBarService* infobar_service,
const extensions::CrxInstallerError& error);
private:
- ErrorInfoBarDelegate(InfoBarService* infobar_service,
- const extensions::CrxInstallerError& error);
+ explicit ErrorInfoBarDelegate(const extensions::CrxInstallerError& error);
virtual ~ErrorInfoBarDelegate();
// ConfirmInfoBarDelegate:
@@ -103,14 +104,13 @@
// static
void ErrorInfoBarDelegate::Create(InfoBarService* infobar_service,
const extensions::CrxInstallerError& error) {
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new ErrorInfoBarDelegate(infobar_service, error)));
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error))));
}
ErrorInfoBarDelegate::ErrorInfoBarDelegate(
- InfoBarService* infobar_service,
const extensions::CrxInstallerError& error)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
error_(error) {
}

Powered by Google App Engine
This is Rietveld 408576698