OLD | NEW |
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 "components/infobars/core/simple_alert_infobar_delegate.h" | 5 #include "components/infobars/core/simple_alert_infobar_delegate.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
8 #include "components/infobars/core/infobar_manager.h" | 10 #include "components/infobars/core/infobar_manager.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
10 | 12 |
11 // static | 13 // static |
12 void SimpleAlertInfoBarDelegate::Create( | 14 void SimpleAlertInfoBarDelegate::Create( |
13 infobars::InfoBarManager* infobar_manager, | 15 infobars::InfoBarManager* infobar_manager, |
14 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, | 16 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, |
15 int icon_id, | 17 int icon_id, |
16 gfx::VectorIconId vector_icon_id, | 18 gfx::VectorIconId vector_icon_id, |
17 const base::string16& message, | 19 const base::string16& message, |
18 bool auto_expire) { | 20 bool auto_expire) { |
19 infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( | 21 infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( |
20 scoped_ptr<ConfirmInfoBarDelegate>(new SimpleAlertInfoBarDelegate( | 22 std::unique_ptr<ConfirmInfoBarDelegate>(new SimpleAlertInfoBarDelegate( |
21 infobar_identifier, icon_id, vector_icon_id, message, auto_expire)))); | 23 infobar_identifier, icon_id, vector_icon_id, message, auto_expire)))); |
22 } | 24 } |
23 | 25 |
24 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( | 26 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( |
25 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, | 27 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, |
26 int icon_id, | 28 int icon_id, |
27 gfx::VectorIconId vector_icon_id, | 29 gfx::VectorIconId vector_icon_id, |
28 const base::string16& message, | 30 const base::string16& message, |
29 bool auto_expire) | 31 bool auto_expire) |
30 : ConfirmInfoBarDelegate(), | 32 : ConfirmInfoBarDelegate(), |
(...skipping 24 matching lines...) Expand all Loading... |
55 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details); | 57 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details); |
56 } | 58 } |
57 | 59 |
58 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const { | 60 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const { |
59 return message_; | 61 return message_; |
60 } | 62 } |
61 | 63 |
62 int SimpleAlertInfoBarDelegate::GetButtons() const { | 64 int SimpleAlertInfoBarDelegate::GetButtons() const { |
63 return BUTTON_NONE; | 65 return BUTTON_NONE; |
64 } | 66 } |
OLD | NEW |