Index: chrome/browser/ui/startup/autolaunch_prompt_win.cc |
=================================================================== |
--- chrome/browser/ui/startup/autolaunch_prompt_win.cc (revision 238220) |
+++ chrome/browser/ui/startup/autolaunch_prompt_win.cc (working copy) |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/auto_launch_trial.h" |
#include "chrome/browser/first_run/first_run.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/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
@@ -36,12 +37,12 @@ |
// The delegate for the infobar shown when Chrome is auto-launched. |
class AutolaunchInfoBarDelegate : public ConfirmInfoBarDelegate { |
public: |
- // Creates an autolaunch infobar delegate and adds it to |infobar_service|. |
+ // Creates an autolaunch infobar and delegate and adds the infobar to |
+ // |infobar_service|. |
static void Create(InfoBarService* infobar_service, Profile* profile); |
private: |
- AutolaunchInfoBarDelegate(InfoBarService* infobar_service, |
- Profile* profile); |
+ explicit AutolaunchInfoBarDelegate(Profile* profile); |
virtual ~AutolaunchInfoBarDelegate(); |
void set_should_expire() { should_expire_ = true; } |
@@ -70,14 +71,14 @@ |
// static |
void AutolaunchInfoBarDelegate::Create(InfoBarService* infobar_service, |
Profile* profile) { |
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
- new AutolaunchInfoBarDelegate(infobar_service, profile))); |
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
+ scoped_ptr<ConfirmInfoBarDelegate>( |
+ new AutolaunchInfoBarDelegate(profile)))); |
} |
AutolaunchInfoBarDelegate::AutolaunchInfoBarDelegate( |
- InfoBarService* infobar_service, |
Profile* profile) |
- : ConfirmInfoBarDelegate(infobar_service), |
+ : ConfirmInfoBarDelegate(), |
profile_(profile), |
should_expire_(false), |
weak_factory_(this) { |