OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_disabled_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 service_(service), | 70 service_(service), |
71 extension_(extension) { | 71 extension_(extension) { |
72 // The user might re-enable the extension in other ways, so watch for that. | 72 // The user might re-enable the extension in other ways, so watch for that. |
73 registrar_.Add(this, NotificationType::EXTENSION_LOADED, | 73 registrar_.Add(this, NotificationType::EXTENSION_LOADED, |
74 Source<Profile>(service->profile())); | 74 Source<Profile>(service->profile())); |
75 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED, | 75 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED, |
76 Source<Profile>(service->profile())); | 76 Source<Profile>(service->profile())); |
77 } | 77 } |
78 virtual ~ExtensionDisabledInfobarDelegate() { | 78 virtual ~ExtensionDisabledInfobarDelegate() { |
79 } | 79 } |
80 virtual std::wstring GetMessageText() const { | 80 virtual string16 GetMessageText() const { |
81 return l10n_util::GetStringF(IDS_EXTENSION_DISABLED_INFOBAR_LABEL, | 81 return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_INFOBAR_LABEL, |
82 UTF8ToWide(extension_->name())); | 82 UTF8ToUTF16(extension_->name())); |
83 } | 83 } |
84 virtual SkBitmap* GetIcon() const { | 84 virtual SkBitmap* GetIcon() const { |
85 return NULL; | 85 return NULL; |
86 } | 86 } |
87 virtual int GetButtons() const { | 87 virtual int GetButtons() const { |
88 return BUTTON_OK; | 88 return BUTTON_OK; |
89 } | 89 } |
90 virtual std::wstring GetButtonLabel( | 90 virtual string16 GetButtonLabel( |
91 ConfirmInfoBarDelegate::InfoBarButton button) const { | 91 ConfirmInfoBarDelegate::InfoBarButton button) const { |
92 return l10n_util::GetString(IDS_EXTENSION_DISABLED_INFOBAR_ENABLE_BUTTON); | 92 return l10n_util::GetStringUTF16( |
| 93 IDS_EXTENSION_DISABLED_INFOBAR_ENABLE_BUTTON); |
93 } | 94 } |
94 virtual bool Accept() { | 95 virtual bool Accept() { |
95 // This object manages its own lifetime. | 96 // This object manages its own lifetime. |
96 new ExtensionDisabledDialogDelegate(tab_contents_->profile(), | 97 new ExtensionDisabledDialogDelegate(tab_contents_->profile(), |
97 service_, extension_); | 98 service_, extension_); |
98 return true; | 99 return true; |
99 } | 100 } |
100 virtual void InfoBarClosed() { | 101 virtual void InfoBarClosed() { |
101 delete this; | 102 delete this; |
102 } | 103 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 139 |
139 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 140 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
140 tab_contents, service, extension)); | 141 tab_contents, service, extension)); |
141 } | 142 } |
142 | 143 |
143 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, | 144 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, |
144 Extension* extension) { | 145 Extension* extension) { |
145 // This object manages its own lifetime. | 146 // This object manages its own lifetime. |
146 new ExtensionDisabledDialogDelegate(profile, service, extension); | 147 new ExtensionDisabledDialogDelegate(profile, service, extension); |
147 } | 148 } |
OLD | NEW |