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 "components/infobars/core/simple_alert_infobar_delegate.h"
7 #include "components/infobars/core/infobar.h"
8 #include "components/infobars/core/infobar_manager.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
12 void SimpleAlertInfoBarDelegate::Create(
13 infobars::InfoBarManager
* infobar_manager
,
15 const base::string16
& message
,
17 infobar_manager
->AddInfoBar(
18 infobar_manager
->CreateConfirmInfoBar(scoped_ptr
<ConfirmInfoBarDelegate
>(
19 new SimpleAlertInfoBarDelegate(icon_id
, message
, auto_expire
))));
22 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
24 const base::string16
& message
,
26 : ConfirmInfoBarDelegate(),
29 auto_expire_(auto_expire
) {
32 SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() {
35 int SimpleAlertInfoBarDelegate::GetIconId() const {
39 bool SimpleAlertInfoBarDelegate::ShouldExpire(
40 const NavigationDetails
& details
) const {
41 return auto_expire_
&& ConfirmInfoBarDelegate::ShouldExpire(details
);
44 base::string16
SimpleAlertInfoBarDelegate::GetMessageText() const {
48 int SimpleAlertInfoBarDelegate::GetButtons() const {