summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 22:37:45 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 22:37:45 +0000
commitd1318574ee4f31f1a8fbea9d8584c89c069af987 (patch)
tree44914e9ea575a25c544b0ec9bc0925e7c2f3f0ea /chrome/browser/task_manager
parent1308ac961fdd5148ce95e228fe192175584a5464 (diff)
downloadchromium_src-d1318574ee4f31f1a8fbea9d8584c89c069af987.zip
chromium_src-d1318574ee4f31f1a8fbea9d8584c89c069af987.tar.gz
chromium_src-d1318574ee4f31f1a8fbea9d8584c89c069af987.tar.bz2
Revert 70281 - Revert 70271 - Remove wstring from l10n_util. Part 3.
BUG=9911 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6044006 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/6051012 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/5989012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager')
-rw-r--r--chrome/browser/task_manager/task_manager_browsertest.cc12
-rw-r--r--chrome/browser/task_manager/task_manager_resource_providers.cc26
2 files changed, 20 insertions, 18 deletions
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc
index b944869..786e892 100644
--- a/chrome/browser/task_manager/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -110,8 +110,8 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeTabContentsChanges) {
// Check that the third entry is a tab contents resource whose title starts
// starts with "Tab:".
ASSERT_TRUE(model()->GetResourceTabContents(2) != NULL);
- string16 prefix = WideToUTF16Hack(l10n_util::GetStringF(
- IDS_TASK_MANAGER_TAB_PREFIX, L""));
+ string16 prefix = l10n_util::GetStringFUTF16(
+ IDS_TASK_MANAGER_TAB_PREFIX, string16());
ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true));
// Close the tab and verify that we notice.
@@ -193,8 +193,8 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeExtensionTabs) {
ASSERT_EQ(TaskManager::Resource::EXTENSION, model()->GetResourceType(2));
ASSERT_TRUE(model()->GetResourceTabContents(2) == NULL);
ASSERT_TRUE(model()->GetResourceExtension(2) != NULL);
- string16 prefix = WideToUTF16Hack(l10n_util::GetStringF(
- IDS_TASK_MANAGER_EXTENSION_PREFIX, L""));
+ string16 prefix = l10n_util::GetStringFUTF16(
+ IDS_TASK_MANAGER_EXTENSION_PREFIX, string16());
ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true));
// Check that the fourth entry (page.html) is of type extension and has both
@@ -233,8 +233,8 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeAppTabs) {
ASSERT_EQ(TaskManager::Resource::EXTENSION, model()->GetResourceType(2));
ASSERT_TRUE(model()->GetResourceTabContents(2) != NULL);
ASSERT_TRUE(model()->GetResourceExtension(2) != NULL);
- string16 prefix = WideToUTF16Hack(l10n_util::GetStringF(
- IDS_TASK_MANAGER_APP_PREFIX, L""));
+ string16 prefix = l10n_util::GetStringFUTF16(
+ IDS_TASK_MANAGER_APP_PREFIX, string16());
ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true));
// Unload extension to avoid crash on Windows.
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index 40a23b2..151d587 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -171,12 +171,11 @@ TaskManager::Resource::Type TaskManagerTabContentsResource::GetType() const {
std::wstring TaskManagerTabContentsResource::GetTitle() const {
// Fall back on the URL if there's no title.
- std::wstring tab_title(UTF16ToWideHack(tab_contents_->GetTitle()));
+ string16 tab_title = tab_contents_->GetTitle();
if (tab_title.empty()) {
- tab_title = UTF8ToWide(tab_contents_->GetURL().spec());
+ tab_title = UTF8ToUTF16(tab_contents_->GetURL().spec());
// Force URL to be LTR.
- tab_title = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality(
- WideToUTF16(tab_title)));
+ tab_title = base::i18n::GetDisplayStringInLTRDirectionality(tab_title);
} else {
// Since the tab_title will be concatenated with
// IDS_TASK_MANAGER_TAB_PREFIX, we need to explicitly set the tab_title to
@@ -196,7 +195,7 @@ std::wstring TaskManagerTabContentsResource::GetTitle() const {
extensions_service->IsInstalledApp(tab_contents_->GetURL()),
tab_contents_->HostsExtension(),
tab_contents_->profile()->IsOffTheRecord());
- return l10n_util::GetStringF(message_id, tab_title);
+ return UTF16ToWideHack(l10n_util::GetStringFUTF16(message_id, tab_title));
}
SkBitmap TaskManagerTabContentsResource::GetIcon() const {
@@ -415,15 +414,16 @@ TaskManagerBackgroundContentsResource::~TaskManagerBackgroundContentsResource(
}
std::wstring TaskManagerBackgroundContentsResource::GetTitle() const {
- std::wstring title = application_name_;
+ string16 title = WideToUTF16Hack(application_name_);
if (title.empty()) {
// No title (can't locate the parent app for some reason) so just display
// the URL (properly forced to be LTR).
- title = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality(
- UTF8ToUTF16(background_contents_->GetURL().spec())));
+ title = base::i18n::GetDisplayStringInLTRDirectionality(
+ UTF8ToUTF16(background_contents_->GetURL().spec()));
}
- return l10n_util::GetStringF(IDS_TASK_MANAGER_BACKGROUND_PREFIX, title);
+ return UTF16ToWideHack(
+ l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_BACKGROUND_PREFIX, title));
}
@@ -881,12 +881,13 @@ TaskManagerExtensionProcessResource::TaskManagerExtensionProcessResource(
}
process_handle_ = extension_host_->render_process_host()->GetHandle();
pid_ = base::GetProcId(process_handle_);
- std::wstring extension_name(UTF8ToWide(GetExtension()->name()));
+ string16 extension_name = UTF8ToUTF16(GetExtension()->name());
DCHECK(!extension_name.empty());
int message_id = GetMessagePrefixID(GetExtension()->is_app(), true,
extension_host_->profile()->IsOffTheRecord());
- title_ = l10n_util::GetStringF(message_id, extension_name);
+ title_ = UTF16ToWideHack(l10n_util::GetStringFUTF16(message_id,
+ extension_name));
}
TaskManagerExtensionProcessResource::~TaskManagerExtensionProcessResource() {
@@ -1263,7 +1264,8 @@ TaskManagerBrowserProcessResource::~TaskManagerBrowserProcessResource() {
// TaskManagerResource methods:
std::wstring TaskManagerBrowserProcessResource::GetTitle() const {
if (title_.empty()) {
- title_ = l10n_util::GetString(IDS_TASK_MANAGER_WEB_BROWSER_CELL_TEXT);
+ title_ = UTF16ToWideHack(
+ l10n_util::GetStringUTF16(IDS_TASK_MANAGER_WEB_BROWSER_CELL_TEXT));
}
return title_;
}