Index: chrome/browser/task_manager/task_manager.cc |
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc |
index 35c8e966fa737392beed0ab5fdc931f4b284af47..a0cf83886780212d68000e78b17fd6fb79a42f90 100644 |
--- a/chrome/browser/task_manager/task_manager.cc |
+++ b/chrome/browser/task_manager/task_manager.cc |
@@ -36,6 +36,7 @@ |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
+#include "ui/base/text/bytes_formatting.h" |
#include "unicode/coll.h" |
#if defined(OS_MACOSX) |
@@ -63,8 +64,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, |
- FormatBytes(stat.size, DATA_UNITS_KIBIBYTE, false), |
- FormatBytes(stat.liveSize, DATA_UNITS_KIBIBYTE, false)); |
+ ui::FormatBytes(stat.size, ui::DATA_UNITS_KIBIBYTE, false), |
+ ui::FormatBytes(stat.liveSize, ui::DATA_UNITS_KIBIBYTE, false)); |
} |
} // namespace |
@@ -128,8 +129,7 @@ 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 = FormatSpeed(net_usage, GetByteDisplayUnits(net_usage), |
- true); |
+ string16 net_byte = ui::FormatSpeed(net_usage, ui::DATA_UNITS_NATURAL, true); |
// Force number string to have LTR directionality. |
return base::i18n::GetDisplayStringInLTRDirectionality(net_byte); |
} |
@@ -237,12 +237,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, |
- FormatBytes(resources_[index]->GetV8MemoryAllocated(), |
- DATA_UNITS_KIBIBYTE, |
- false), |
- FormatBytes(resources_[index]->GetV8MemoryUsed(), |
- DATA_UNITS_KIBIBYTE, |
- false)); |
+ ui::FormatBytes(resources_[index]->GetV8MemoryAllocated(), |
+ ui::DATA_UNITS_KIBIBYTE, |
+ false), |
+ ui::FormatBytes(resources_[index]->GetV8MemoryUsed(), |
+ ui::DATA_UNITS_KIBIBYTE, |
+ false)); |
} |
bool TaskManagerModel::IsResourceFirstInGroup(int index) const { |
@@ -491,7 +491,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 FormatBytes(number, GetByteDisplayUnits(number), /*show_units=*/true); |
+ return ui::FormatBytes(number, ui::DATA_UNITS_NATURAL, /*show_units=*/true); |
#endif |
} |