Index: chrome/browser/ui/auto_login_info_bar_delegate.cc |
=================================================================== |
--- chrome/browser/ui/auto_login_info_bar_delegate.cc (revision 175396) |
+++ chrome/browser/ui/auto_login_info_bar_delegate.cc (working copy) |
@@ -165,24 +165,13 @@ |
AutoLoginInfoBarDelegate::Params::Params() {} |
AutoLoginInfoBarDelegate::Params::~Params() {} |
-AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate( |
- InfoBarService* owner, |
- const Params& params) |
- : ConfirmInfoBarDelegate(owner), |
- params_(params), |
- button_pressed_(false) { |
- RecordHistogramAction(HISTOGRAM_SHOWN); |
- registrar_.Add(this, |
- chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
- content::Source<Profile>(Profile::FromBrowserContext( |
- owner->GetWebContents()->GetBrowserContext()))); |
+// static |
+void AutoLoginInfoBarDelegate::Create(InfoBarService* infobar_service, |
+ const Params& params) { |
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
+ new AutoLoginInfoBarDelegate(infobar_service, params))); |
} |
-AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() { |
- if (!button_pressed_) |
- RecordHistogramAction(HISTOGRAM_IGNORED); |
-} |
- |
AutoLoginInfoBarDelegate* |
AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() { |
return this; |
@@ -237,6 +226,24 @@ |
UTF8ToUTF16(username)); |
} |
+AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate( |
+ InfoBarService* owner, |
+ const Params& params) |
+ : ConfirmInfoBarDelegate(owner), |
+ params_(params), |
+ button_pressed_(false) { |
+ RecordHistogramAction(HISTOGRAM_SHOWN); |
+ registrar_.Add(this, |
+ chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
+ content::Source<Profile>(Profile::FromBrowserContext( |
+ owner->GetWebContents()->GetBrowserContext()))); |
+} |
+ |
+AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() { |
+ if (!button_pressed_) |
+ RecordHistogramAction(HISTOGRAM_IGNORED); |
+} |
+ |
void AutoLoginInfoBarDelegate::RecordHistogramAction(int action) { |
UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX); |
} |