From 7b83a107f3feaa0bd220b0ac6f983d7a3b82c44e Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 19 Aug 2010 23:11:28 +0000 Subject: Convert FormatBytes to string16. I considered ASCII, but it's producing what is intended to be a human-readable string. For example, in theory the "bytes/s" annotation could be localized into a language where the "b" is non-ASCII. Review URL: http://codereview.chromium.org/3107021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56771 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/task_manager.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'chrome/browser/task_manager.cc') diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index fb236e3..967f732 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -59,8 +59,8 @@ int ValueCompare(T value1, T value2) { string16 FormatStatsSize(const WebKit::WebCache::ResourceTypeStat& stat) { return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_CACHE_SIZE_CELL_TEXT, - WideToUTF16Hack(FormatBytes(stat.size, DATA_UNITS_KIBIBYTE, false)), - WideToUTF16Hack(FormatBytes(stat.liveSize, DATA_UNITS_KIBIBYTE, false))); + FormatBytes(stat.size, DATA_UNITS_KIBIBYTE, false), + FormatBytes(stat.liveSize, DATA_UNITS_KIBIBYTE, false)); } } // namespace @@ -126,8 +126,8 @@ string16 TaskManagerModel::GetResourceNetworkUsage(int index) const { return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); if (net_usage == 0) return ASCIIToUTF16("0"); - string16 net_byte = WideToUTF16( - FormatSpeed(net_usage, GetByteDisplayUnits(net_usage), true)); + string16 net_byte = FormatSpeed(net_usage, GetByteDisplayUnits(net_usage), + true); // Force number string to have LTR directionality. return base::i18n::GetDisplayStringInLTRDirectionality(net_byte); } @@ -217,12 +217,12 @@ string16 TaskManagerModel::GetResourceV8MemoryAllocatedSize( if (!resources_[index]->ReportsV8MemoryStats()) return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_CACHE_SIZE_CELL_TEXT, - WideToUTF16Hack(FormatBytes(resources_[index]->GetV8MemoryAllocated(), - DATA_UNITS_KIBIBYTE, - false)), - WideToUTF16Hack(FormatBytes(resources_[index]->GetV8MemoryUsed(), - DATA_UNITS_KIBIBYTE, - false))); + FormatBytes(resources_[index]->GetV8MemoryAllocated(), + DATA_UNITS_KIBIBYTE, + false), + FormatBytes(resources_[index]->GetV8MemoryUsed(), + DATA_UNITS_KIBIBYTE, + false)); } bool TaskManagerModel::IsResourceFirstInGroup(int index) const { @@ -477,8 +477,7 @@ string16 TaskManagerModel::GetMemCellText(int64 number) const { #else // System expectation is to show "100 KB", "200 MB", etc. // TODO(thakis): Switch to metric units (as opposed to powers of two). - return WideToUTF16Hack( - FormatBytes(number, GetByteDisplayUnits(number), /*show_units=*/true)); + return FormatBytes(number, GetByteDisplayUnits(number), /*show_units=*/true); #endif } -- cgit v1.1