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

Unified Diff: trunk/src/chrome/browser/ui/auto_login_infobar_delegate.cc

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
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: trunk/src/chrome/browser/ui/auto_login_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/ui/auto_login_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/ui/auto_login_infobar_delegate.cc (working copy)
@@ -13,7 +13,6 @@
#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"
@@ -128,18 +127,19 @@
// static
void AutoLoginInfoBarDelegate::Create(InfoBarService* infobar_service,
const Params& params) {
- infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
#if defined(OS_ANDROID)
- new AutoLoginInfoBarDelegateAndroid(params)
+ new AutoLoginInfoBarDelegateAndroid(infobar_service, params)
#else
- new AutoLoginInfoBarDelegate(params)
+ new AutoLoginInfoBarDelegate(infobar_service, params)
#endif
- )));
+ ));
}
-AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(const Params& params)
- : ConfirmInfoBarDelegate(),
+AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(
+ InfoBarService* owner,
+ const Params& params)
+ : ConfirmInfoBarDelegate(owner),
params_(params),
button_pressed_(false) {
RecordHistogramAction(SHOWN);
@@ -204,7 +204,10 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, type);
- infobar()->RemoveSelf();
+ // owner() can be NULL when InfoBarService removes us. See
+ // |InfoBarDelegate::clear_owner|.
+ if (owner())
+ owner()->RemoveInfoBar(this);
}
void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {

Powered by Google App Engine
This is Rietveld 408576698