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

Unified Diff: chrome/browser/ui/cocoa/keystone_infobar_delegate.mm

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/cocoa/keystone_infobar_delegate.mm
===================================================================
--- chrome/browser/ui/cocoa/keystone_infobar_delegate.mm (revision 238220)
+++ chrome/browser/ui/cocoa/keystone_infobar_delegate.mm (working copy)
@@ -15,6 +15,7 @@
#include "base/prefs/pref_service.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"
#import "chrome/browser/mac/keystone_glue.h"
#include "chrome/browser/profiles/profile.h"
@@ -43,8 +44,7 @@
static void Create();
private:
- KeystonePromotionInfoBarDelegate(InfoBarService* infobar_service,
- PrefService* prefs);
+ explicit KeystonePromotionInfoBarDelegate(PrefService* prefs);
virtual ~KeystonePromotionInfoBarDelegate();
// Sets this info bar to be able to expire. Called a predetermined amount
@@ -83,17 +83,15 @@
return;
InfoBarService* infobar_service =
InfoBarService::FromWebContents(webContents);
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new KeystonePromotionInfoBarDelegate(
- infobar_service,
+ infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(new KeystonePromotionInfoBarDelegate(
Profile::FromBrowserContext(
- webContents->GetBrowserContext())->GetPrefs())));
+ webContents->GetBrowserContext())->GetPrefs()))));
}
KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate(
- InfoBarService* infobar_service,
PrefService* prefs)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
prefs_(prefs),
can_expire_(false),
weak_ptr_factory_(this) {
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm ('k') | chrome/browser/ui/collected_cookies_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698