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

Unified Diff: chrome/browser/ui/auto_login_info_bar_delegate.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/ui/auto_login_info_bar_delegate.h ('k') | chrome/browser/ui/auto_login_prompter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/ui/auto_login_info_bar_delegate.h ('k') | chrome/browser/ui/auto_login_prompter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698