NaCl: Update revision in DEPS, 2363d1a -> 66f4b73
[chromium-blink-merge.git] / components / infobars / core / simple_alert_infobar_delegate.cc
blob9262d05e54cb1c5535d8309e204b9bb5278f0929
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"
11 // static
12 void SimpleAlertInfoBarDelegate::Create(
13 infobars::InfoBarManager* infobar_manager,
14 int icon_id,
15 const base::string16& message,
16 bool auto_expire) {
17 infobar_manager->AddInfoBar(
18 infobar_manager->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
19 new SimpleAlertInfoBarDelegate(icon_id, message, auto_expire))));
22 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
23 int icon_id,
24 const base::string16& message,
25 bool auto_expire)
26 : ConfirmInfoBarDelegate(),
27 icon_id_(icon_id),
28 message_(message),
29 auto_expire_(auto_expire) {
32 SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() {
35 int SimpleAlertInfoBarDelegate::GetIconID() const {
36 return icon_id_;
39 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const {
40 return message_;
43 int SimpleAlertInfoBarDelegate::GetButtons() const {
44 return BUTTON_NONE;
47 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal(
48 const NavigationDetails& details) const {
49 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details);