Rename GetIconID to GetIconId
[chromium-blink-merge.git] / components / infobars / core / simple_alert_infobar_delegate.cc
blob7385fd6e617a30dcc5bf149cc8c10dd99a2b6192
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 bool SimpleAlertInfoBarDelegate::ShouldExpire(
40 const NavigationDetails& details) const {
41 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details);
44 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const {
45 return message_;
48 int SimpleAlertInfoBarDelegate::GetButtons() const {
49 return BUTTON_NONE;