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
3 // found in the LICENSE file.
5 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h"
7 #include "chrome/browser/infobars/infobar_service.h"
8 #include "components/infobars/core/infobar.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
12 void SimpleAlertInfoBarDelegate::Create(InfoBarService
* infobar_service
,
14 const base::string16
& message
,
16 infobar_service
->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
17 scoped_ptr
<ConfirmInfoBarDelegate
>(
18 new SimpleAlertInfoBarDelegate(icon_id
, message
, auto_expire
))));
21 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
23 const base::string16
& message
,
25 : ConfirmInfoBarDelegate(),
28 auto_expire_(auto_expire
) {
31 SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() {
34 int SimpleAlertInfoBarDelegate::GetIconID() const {
38 base::string16
SimpleAlertInfoBarDelegate::GetMessageText() const {
42 int SimpleAlertInfoBarDelegate::GetButtons() const {
46 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal(
47 const NavigationDetails
& details
) const {
48 return auto_expire_
&& ConfirmInfoBarDelegate::ShouldExpireInternal(details
);