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

Side by Side Diff: chrome/browser/api/infobars/simple_alert_infobar_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" 5 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h"
6 6
7 #include "chrome/browser/api/infobars/infobar_service.h"
7 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
8 9
10 // static
11 void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service,
12 gfx::Image* icon,
13 const string16& message,
14 bool auto_expire) {
15 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
16 new SimpleAlertInfoBarDelegate(infobar_service, icon, message,
17 auto_expire)));
18 }
19
9 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( 20 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
10 InfoBarService* infobar_service, 21 InfoBarService* infobar_service,
11 gfx::Image* icon, 22 gfx::Image* icon,
12 const string16& message, 23 const string16& message,
13 bool auto_expire) 24 bool auto_expire)
14 : ConfirmInfoBarDelegate(infobar_service), 25 : ConfirmInfoBarDelegate(infobar_service),
15 icon_(icon), 26 icon_(icon),
16 message_(message), 27 message_(message),
17 auto_expire_(auto_expire) { 28 auto_expire_(auto_expire) {
18 } 29 }
(...skipping 10 matching lines...) Expand all
29 } 40 }
30 41
31 int SimpleAlertInfoBarDelegate::GetButtons() const { 42 int SimpleAlertInfoBarDelegate::GetButtons() const {
32 return BUTTON_NONE; 43 return BUTTON_NONE;
33 } 44 }
34 45
35 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal( 46 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal(
36 const content::LoadCommittedDetails& details) const { 47 const content::LoadCommittedDetails& details) const {
37 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details); 48 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details);
38 } 49 }
OLDNEW
« no previous file with comments | « chrome/browser/api/infobars/simple_alert_infobar_delegate.h ('k') | chrome/browser/autofill/autofill_cc_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698