diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 21:59:31 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 21:59:31 +0000 |
commit | c3265d8866e5b0d2c1b129e4da685755a35a84b2 (patch) | |
tree | 276afaff1dee110f08bc0e2999dc55ce82e6db95 /chrome | |
parent | 147af6dcdc20b7162ed186ab18eeced8123ba9a0 (diff) | |
download | chromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.zip chromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.tar.gz chromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.tar.bz2 |
Revert "Convert FormatBytes to string16."
This reverts commit r56603.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56608 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/diagnostics/recon_diagnostics.cc | 6 | ||||
-rw-r--r-- | chrome/browser/download/download_item_model.cc | 11 | ||||
-rw-r--r-- | chrome/browser/download/download_util.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_chrome_cookie_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/task_manager.cc | 20 |
5 files changed, 29 insertions, 27 deletions
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc index bbe23f7..eb76c2b 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.cc +++ b/chrome/browser/diagnostics/recon_diagnostics.cc @@ -203,7 +203,8 @@ class PathTest : public DiagnosticTest { return true; } DataUnits units = GetByteDisplayUnits(dir_or_file_size); - string16 printable_size = FormatBytes(dir_or_file_size, units, true); + string16 printable_size = + WideToUTF16(FormatBytes(dir_or_file_size, units, true)); if (path_info_.max_size > 0) { if (dir_or_file_size > path_info_.max_size) { @@ -247,7 +248,8 @@ class DiskSpaceTest : public DiagnosticTest { return true; } DataUnits units = GetByteDisplayUnits(disk_space); - string16 printable_size = FormatBytes(disk_space, units, true); + string16 printable_size = + WideToUTF16(FormatBytes(disk_space, units, true)); if (disk_space < 80 * kOneMeg) { RecordFailure(ASCIIToUTF16("Low disk space : ") + printable_size); return true; diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index 48c75ad..c360273 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc @@ -32,15 +32,17 @@ std::wstring DownloadItemModel::GetStatusText() { int64 total = download_->total_bytes(); DataUnits amount_units = GetByteDisplayUnits(total); - const string16 simple_size = FormatBytes(size, amount_units, false); + const string16 simple_size = WideToUTF16Hack(FormatBytes(size, amount_units, + false)); // In RTL locales, we render the text "size/total" in an RTL context. This // is problematic since a string such as "123/456 MB" is displayed // as "MB 123/456" because it ends with an LTR run. In order to solve this, // we mark the total string as an LTR string if the UI layout is // right-to-left so that the string "456 MB" is treated as an LTR run. - string16 simple_total = base::i18n::GetDisplayStringInLTRDirectionality( - FormatBytes(total, amount_units, true)); + string16 simple_total = WideToUTF16Hack(FormatBytes(total, amount_units, + true)); + simple_total = base::i18n::GetDisplayStringInLTRDirectionality(simple_total); TimeDelta remaining; string16 simple_time; @@ -69,7 +71,8 @@ std::wstring DownloadItemModel::GetStatusText() { // Instead of displaying "0 B" we keep the "Starting..." string. status_text = (size == 0) ? l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING) : - FormatBytes(size, GetByteDisplayUnits(size), true); + WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size), + true)); } else { status_text = l10n_util::GetStringFUTF16( IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size, simple_total, diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index e7f75c9..e76bf6e 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -591,8 +591,7 @@ std::wstring GetProgressStatusText(DownloadItem* download) { int64 total = download->total_bytes(); int64 size = download->received_bytes(); DataUnits amount_units = GetByteDisplayUnits(size); - std::wstring received_size = UTF16ToWideHack(FormatBytes(size, amount_units, - true)); + std::wstring received_size = FormatBytes(size, amount_units, true); std::wstring amount = received_size; // Adjust both strings for the locale direction since we don't yet know which @@ -605,8 +604,7 @@ std::wstring GetProgressStatusText(DownloadItem* download) { if (total) { amount_units = GetByteDisplayUnits(total); - std::wstring total_text = - UTF16ToWideHack(FormatBytes(total, amount_units, true)); + std::wstring total_text = FormatBytes(total, amount_units, true); std::wstring total_text_localized; if (base::i18n::AdjustStringForLocaleDirection(total_text, &total_text_localized)) @@ -619,9 +617,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) { amount.assign(received_size); } amount_units = GetByteDisplayUnits(download->CurrentSpeed()); - std::wstring speed_text = - UTF16ToWideHack(FormatSpeed(download->CurrentSpeed(), amount_units, - true)); + std::wstring speed_text = FormatSpeed(download->CurrentSpeed(), + amount_units, true); std::wstring speed_text_localized; if (base::i18n::AdjustStringForLocaleDirection(speed_text, &speed_text_localized)) diff --git a/chrome/browser/gtk/gtk_chrome_cookie_view.cc b/chrome/browser/gtk/gtk_chrome_cookie_view.cc index 5ecba7e..359cdca 100644 --- a/chrome/browser/gtk/gtk_chrome_cookie_view.cc +++ b/chrome/browser/gtk/gtk_chrome_cookie_view.cc @@ -512,7 +512,7 @@ void gtk_chrome_cookie_view_display_database( gtk_entry_set_text(GTK_ENTRY(self->database_description_entry_), database_info.description.c_str()); gtk_entry_set_text(GTK_ENTRY(self->database_size_entry_), - UTF16ToUTF8(FormatBytes( + WideToUTF8(FormatBytes( database_info.size, GetByteDisplayUnits(database_info.size), true)).c_str()); @@ -532,7 +532,7 @@ void gtk_chrome_cookie_view_display_local_storage( gtk_entry_set_text(GTK_ENTRY(self->local_storage_origin_entry_), local_storage_info.origin.c_str()); gtk_entry_set_text(GTK_ENTRY(self->local_storage_size_entry_), - UTF16ToUTF8(FormatBytes( + WideToUTF8(FormatBytes( local_storage_info.size, GetByteDisplayUnits(local_storage_info.size), true)).c_str()); @@ -551,7 +551,7 @@ void gtk_chrome_cookie_view_display_app_cache( gtk_entry_set_text(GTK_ENTRY(self->appcache_manifest_entry_), info.manifest_url.spec().c_str()); gtk_entry_set_text(GTK_ENTRY(self->appcache_size_entry_), - UTF16ToUTF8(FormatBytes( + WideToUTF8(FormatBytes( info.size, GetByteDisplayUnits(info.size), true)).c_str()); @@ -595,7 +595,7 @@ void gtk_chrome_cookie_view_display_database_accessed( gtk_entry_set_text(GTK_ENTRY(self->database_accessed_description_entry_), UTF16ToUTF8(display_name).c_str()); gtk_entry_set_text(GTK_ENTRY(self->database_accessed_size_entry_), - UTF16ToUTF8(FormatBytes( + WideToUTF8(FormatBytes( estimated_size, GetByteDisplayUnits(estimated_size), true)).c_str()); diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index f8ffc10..fb236e3 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, - FormatBytes(stat.size, DATA_UNITS_KIBIBYTE, false), - FormatBytes(stat.liveSize, DATA_UNITS_KIBIBYTE, false)); + WideToUTF16Hack(FormatBytes(stat.size, DATA_UNITS_KIBIBYTE, false)), + WideToUTF16Hack(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 = FormatSpeed(net_usage, GetByteDisplayUnits(net_usage), - true); + string16 net_byte = WideToUTF16( + 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, - FormatBytes(resources_[index]->GetV8MemoryAllocated(), - DATA_UNITS_KIBIBYTE, - false), - FormatBytes(resources_[index]->GetV8MemoryUsed(), - DATA_UNITS_KIBIBYTE, - false)); + WideToUTF16Hack(FormatBytes(resources_[index]->GetV8MemoryAllocated(), + DATA_UNITS_KIBIBYTE, + false)), + WideToUTF16Hack(FormatBytes(resources_[index]->GetV8MemoryUsed(), + DATA_UNITS_KIBIBYTE, + false))); } bool TaskManagerModel::IsResourceFirstInGroup(int index) const { |