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 "chrome/browser/infobars/simple_alert_infobar_delegate.h" | 5 #include "components/infobars/core/simple_alert_infobar_delegate.h" |
6 | 6 |
7 #include "chrome/browser/infobars/infobar_service.h" | |
8 #include "components/infobars/core/infobar.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" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 | 10 |
11 // static | 11 // static |
12 void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service, | 12 void SimpleAlertInfoBarDelegate::Create( |
13 int icon_id, | 13 infobars::InfoBarManager* infobar_manager, |
14 const base::string16& message, | 14 int icon_id, |
15 bool auto_expire) { | 15 const base::string16& message, |
16 infobar_service->AddInfoBar( | 16 bool auto_expire) { |
17 infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( | 17 infobar_manager->AddInfoBar( |
| 18 infobar_manager->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
18 new SimpleAlertInfoBarDelegate(icon_id, message, auto_expire)))); | 19 new SimpleAlertInfoBarDelegate(icon_id, message, auto_expire)))); |
19 } | 20 } |
20 | 21 |
21 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( | 22 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( |
22 int icon_id, | 23 int icon_id, |
23 const base::string16& message, | 24 const base::string16& message, |
24 bool auto_expire) | 25 bool auto_expire) |
25 : ConfirmInfoBarDelegate(), | 26 : ConfirmInfoBarDelegate(), |
26 icon_id_(icon_id), | 27 icon_id_(icon_id), |
27 message_(message), | 28 message_(message), |
(...skipping 12 matching lines...) Expand all Loading... |
40 } | 41 } |
41 | 42 |
42 int SimpleAlertInfoBarDelegate::GetButtons() const { | 43 int SimpleAlertInfoBarDelegate::GetButtons() const { |
43 return BUTTON_NONE; | 44 return BUTTON_NONE; |
44 } | 45 } |
45 | 46 |
46 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal( | 47 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal( |
47 const NavigationDetails& details) const { | 48 const NavigationDetails& details) const { |
48 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details); | 49 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details); |
49 } | 50 } |
OLD | NEW |