OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/infobar_delegate.h" | 5 #include "chrome/browser/tab_contents/infobar_delegate.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/tab_contents/navigation_entry.h" | 10 #include "chrome/browser/tab_contents/navigation_entry.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 // LinkInfoBarDelegate: -------------------------------------------------------- | 50 // LinkInfoBarDelegate: -------------------------------------------------------- |
51 | 51 |
52 LinkInfoBarDelegate::LinkInfoBarDelegate(TabContents* contents) | 52 LinkInfoBarDelegate::LinkInfoBarDelegate(TabContents* contents) |
53 : InfoBarDelegate(contents) { | 53 : InfoBarDelegate(contents) { |
54 } | 54 } |
55 | 55 |
56 // ConfirmInfoBarDelegate: ----------------------------------------------------- | 56 // ConfirmInfoBarDelegate: ----------------------------------------------------- |
57 | 57 |
58 std::wstring ConfirmInfoBarDelegate::GetButtonLabel( | 58 string16 ConfirmInfoBarDelegate::GetButtonLabel( |
59 InfoBarButton button) const { | 59 InfoBarButton button) const { |
60 if (button == BUTTON_OK) | 60 if (button == BUTTON_OK) |
61 return l10n_util::GetString(IDS_OK); | 61 return l10n_util::GetStringUTF16(IDS_OK); |
62 if (button == BUTTON_CANCEL) | 62 if (button == BUTTON_CANCEL) |
63 return l10n_util::GetString(IDS_CANCEL); | 63 return l10n_util::GetStringUTF16(IDS_CANCEL); |
64 NOTREACHED(); | 64 NOTREACHED(); |
65 return std::wstring(); | 65 return string16(); |
66 } | 66 } |
67 | 67 |
68 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate(TabContents* contents) | 68 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate(TabContents* contents) |
69 : AlertInfoBarDelegate(contents) { | 69 : AlertInfoBarDelegate(contents) { |
70 } | 70 } |
71 | 71 |
72 // SimpleAlertInfoBarDelegate: ------------------------------------------------- | 72 // SimpleAlertInfoBarDelegate: ------------------------------------------------- |
73 | 73 |
74 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( | 74 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( |
75 TabContents* contents, | 75 TabContents* contents, |
76 const std::wstring& message, | 76 const string16& message, |
77 SkBitmap* icon, | 77 SkBitmap* icon, |
78 bool auto_expire) | 78 bool auto_expire) |
79 : AlertInfoBarDelegate(contents), | 79 : AlertInfoBarDelegate(contents), |
80 message_(message), | 80 message_(message), |
81 icon_(icon), | 81 icon_(icon), |
82 auto_expire_(auto_expire) { | 82 auto_expire_(auto_expire) { |
83 } | 83 } |
84 | 84 |
85 bool SimpleAlertInfoBarDelegate::ShouldExpire( | 85 bool SimpleAlertInfoBarDelegate::ShouldExpire( |
86 const NavigationController::LoadCommittedDetails& details) const { | 86 const NavigationController::LoadCommittedDetails& details) const { |
87 if (auto_expire_) | 87 if (auto_expire_) |
88 return AlertInfoBarDelegate::ShouldExpire(details); | 88 return AlertInfoBarDelegate::ShouldExpire(details); |
89 | 89 |
90 return false; | 90 return false; |
91 } | 91 } |
92 | 92 |
93 std::wstring SimpleAlertInfoBarDelegate::GetMessageText() const { | 93 string16 SimpleAlertInfoBarDelegate::GetMessageText() const { |
94 return message_; | 94 return message_; |
95 } | 95 } |
96 | 96 |
97 SkBitmap* SimpleAlertInfoBarDelegate::GetIcon() const { | 97 SkBitmap* SimpleAlertInfoBarDelegate::GetIcon() const { |
98 return icon_; | 98 return icon_; |
99 } | 99 } |
100 | 100 |
101 void SimpleAlertInfoBarDelegate::InfoBarClosed() { | 101 void SimpleAlertInfoBarDelegate::InfoBarClosed() { |
102 delete this; | 102 delete this; |
103 } | 103 } |
OLD | NEW |