Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 3127009: Convert infobar APIs to UTF-16. (Closed)
Patch Set: works Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 1d2e028a4bb7226aad131defb47e9ddd23a0bb74..074029caa150f0dd0fe388be3a03967744f2a20e 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -253,21 +253,20 @@ class DisabledPluginInfoBar : public ConfirmInfoBarDelegate {
return BUTTON_OK | BUTTON_CANCEL | BUTTON_OK_DEFAULT;
}
- virtual std::wstring GetButtonLabel(InfoBarButton button) const {
+ virtual string16 GetButtonLabel(InfoBarButton button) const {
if (button == BUTTON_CANCEL)
- return l10n_util::GetString(IDS_PLUGIN_ENABLE_TEMPORARILY);
+ return l10n_util::GetStringUTF16(IDS_PLUGIN_ENABLE_TEMPORARILY);
if (button == BUTTON_OK)
- return l10n_util::GetString(IDS_PLUGIN_UPDATE);
+ return l10n_util::GetStringUTF16(IDS_PLUGIN_UPDATE);
return ConfirmInfoBarDelegate::GetButtonLabel(button);
}
- virtual std::wstring GetMessageText() const {
- return UTF16ToWide(l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED_PROMPT,
- name_));
+ virtual string16 GetMessageText() const {
+ return l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED_PROMPT, name_);
}
- virtual std::wstring GetLinkText() {
- return l10n_util::GetString(IDS_LEARN_MORE);
+ virtual string16 GetLinkText() {
+ return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
}
virtual SkBitmap* GetIcon() const {
@@ -1993,13 +1992,14 @@ void TabContents::OnCrashedPlugin(const FilePath& plugin_path) {
SkBitmap* crash_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_INFOBAR_PLUGIN_CRASHED);
AddInfoBar(new SimpleAlertInfoBarDelegate(
- this, l10n_util::GetStringF(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
+ this, l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT,
+ WideToUTF16Hack(plugin_name)),
crash_icon, true));
}
void TabContents::OnCrashedWorker() {
AddInfoBar(new SimpleAlertInfoBarDelegate(
- this, l10n_util::GetString(IDS_WEBWORKER_CRASHED_PROMPT),
+ this, l10n_util::GetStringUTF16(IDS_WEBWORKER_CRASHED_PROMPT),
NULL, true));
}
@@ -2868,7 +2868,8 @@ void TabContents::OnIgnoredUIEvent() {
void TabContents::OnJSOutOfMemory() {
AddInfoBar(new SimpleAlertInfoBarDelegate(
- this, l10n_util::GetString(IDS_JS_OUT_OF_MEMORY_PROMPT), NULL, true));
+ this, l10n_util::GetStringUTF16(IDS_JS_OUT_OF_MEMORY_PROMPT),
+ NULL, true));
}
void TabContents::OnCrossSiteResponse(int new_render_process_host_id,
@@ -3246,8 +3247,8 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
virtual Type GetInfoBarType() { return PAGE_ACTION_TYPE; }
- virtual std::wstring GetMessageText() const {
- return l10n_util::GetString(IDS_PASSWORD_MANAGER_SAVE_PASSWORD_PROMPT);
+ virtual string16 GetMessageText() const {
+ return l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_PASSWORD_PROMPT);
}
virtual SkBitmap* GetIcon() const {
@@ -3259,13 +3260,13 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
return BUTTON_OK | BUTTON_CANCEL;
}
- virtual std::wstring GetButtonLabel(InfoBarButton button) const {
+ virtual string16 GetButtonLabel(InfoBarButton button) const {
if (button == BUTTON_OK)
- return l10n_util::GetString(IDS_PASSWORD_MANAGER_SAVE_BUTTON);
+ return l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_BUTTON);
if (button == BUTTON_CANCEL)
- return l10n_util::GetString(IDS_PASSWORD_MANAGER_BLACKLIST_BUTTON);
+ return l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_BLACKLIST_BUTTON);
NOTREACHED();
- return std::wstring();
+ return string16();
}
virtual bool Accept() {

Powered by Google App Engine
This is Rietveld 408576698