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

Unified Diff: chrome/browser/ui/auto_login_infobar_delegate.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/auto_login_infobar_delegate.cc
===================================================================
--- chrome/browser/ui/auto_login_infobar_delegate.cc (revision 238220)
+++ chrome/browser/ui/auto_login_infobar_delegate.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/google/google_util.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/ubertoken_fetcher.h"
@@ -127,19 +128,18 @@
// static
void AutoLoginInfoBarDelegate::Create(InfoBarService* infobar_service,
const Params& params) {
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
#if defined(OS_ANDROID)
- new AutoLoginInfoBarDelegateAndroid(infobar_service, params)
+ new AutoLoginInfoBarDelegateAndroid(params)
#else
- new AutoLoginInfoBarDelegate(infobar_service, params)
+ new AutoLoginInfoBarDelegate(params)
#endif
- ));
+ )));
}
-AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(
- InfoBarService* owner,
- const Params& params)
- : ConfirmInfoBarDelegate(owner),
+AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(const Params& params)
+ : ConfirmInfoBarDelegate(),
params_(params),
button_pressed_(false) {
RecordHistogramAction(SHOWN);
@@ -204,10 +204,7 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type);
- // owner() can be NULL when InfoBarService removes us. See
- // |InfoBarDelegate::clear_owner|.
- if (owner())
- owner()->RemoveInfoBar(this);
+ infobar()->RemoveSelf();
}
void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {
« no previous file with comments | « chrome/browser/ui/auto_login_infobar_delegate.h ('k') | chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698