summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/cookie_details.mm8
-rw-r--r--chrome/browser/diagnostics/recon_diagnostics.cc6
-rw-r--r--chrome/browser/download/download_item_model.cc11
-rw-r--r--chrome/browser/download/download_util.cc11
-rw-r--r--chrome/browser/gtk/gtk_chrome_cookie_view.cc8
-rw-r--r--chrome/browser/task_manager.cc23
6 files changed, 32 insertions, 35 deletions
diff --git a/chrome/browser/cocoa/cookie_details.mm b/chrome/browser/cocoa/cookie_details.mm
index 7d625b2..e2b6626 100644
--- a/chrome/browser/cocoa/cookie_details.mm
+++ b/chrome/browser/cocoa/cookie_details.mm
@@ -153,7 +153,7 @@
canEditExpiration_ = NO;
databaseDescription_.reset([base::SysUTF8ToNSString(
databaseInfo->description) retain]);
- fileSize_.reset([base::SysWideToNSString(FormatBytes(databaseInfo->size,
+ fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(databaseInfo->size,
GetByteDisplayUnits(databaseInfo->size), true)) retain]);
lastModified_.reset([base::SysWideToNSString(
base::TimeFormatFriendlyDateAndTime(
@@ -168,7 +168,7 @@
type_ = kCocoaCookieDetailsTypeTreeLocalStorage;
canEditExpiration_ = NO;
domain_.reset([base::SysUTF8ToNSString(storageInfo->origin) retain]);
- fileSize_.reset([base::SysWideToNSString(FormatBytes(storageInfo->size,
+ fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(storageInfo->size,
GetByteDisplayUnits(storageInfo->size), true)) retain]);
lastModified_.reset([base::SysWideToNSString(
base::TimeFormatFriendlyDateAndTime(
@@ -183,7 +183,7 @@
canEditExpiration_ = NO;
manifestURL_.reset([base::SysUTF8ToNSString(
appcacheInfo->manifest_url.spec()) retain]);
- fileSize_.reset([base::SysWideToNSString(FormatBytes(appcacheInfo->size,
+ fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(appcacheInfo->size,
GetByteDisplayUnits(appcacheInfo->size), true)) retain]);
created_.reset([base::SysWideToNSString(
base::TimeFormatFriendlyDateAndTime(
@@ -206,7 +206,7 @@
domain_.reset([base::SysUTF8ToNSString(domain) retain]);
databaseDescription_.reset(
[base::SysUTF16ToNSString(databaseDescription) retain]);
- fileSize_.reset([base::SysWideToNSString(FormatBytes(fileSize,
+ fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(fileSize,
GetByteDisplayUnits(fileSize), true)) retain]);
}
return self;
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index eb76c2b..bbe23f7 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -203,8 +203,7 @@ class PathTest : public DiagnosticTest {
return true;
}
DataUnits units = GetByteDisplayUnits(dir_or_file_size);
- string16 printable_size =
- WideToUTF16(FormatBytes(dir_or_file_size, units, true));
+ string16 printable_size = FormatBytes(dir_or_file_size, units, true);
if (path_info_.max_size > 0) {
if (dir_or_file_size > path_info_.max_size) {
@@ -248,8 +247,7 @@ class DiskSpaceTest : public DiagnosticTest {
return true;
}
DataUnits units = GetByteDisplayUnits(disk_space);
- string16 printable_size =
- WideToUTF16(FormatBytes(disk_space, units, true));
+ string16 printable_size = 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 c360273..48c75ad 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -32,17 +32,15 @@ std::wstring DownloadItemModel::GetStatusText() {
int64 total = download_->total_bytes();
DataUnits amount_units = GetByteDisplayUnits(total);
- const string16 simple_size = WideToUTF16Hack(FormatBytes(size, amount_units,
- false));
+ const string16 simple_size = 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 = WideToUTF16Hack(FormatBytes(total, amount_units,
- true));
- simple_total = base::i18n::GetDisplayStringInLTRDirectionality(simple_total);
+ string16 simple_total = base::i18n::GetDisplayStringInLTRDirectionality(
+ FormatBytes(total, amount_units, true));
TimeDelta remaining;
string16 simple_time;
@@ -71,8 +69,7 @@ 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) :
- WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size),
- true));
+ 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 e76bf6e..e7f75c9 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -591,7 +591,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
int64 total = download->total_bytes();
int64 size = download->received_bytes();
DataUnits amount_units = GetByteDisplayUnits(size);
- std::wstring received_size = FormatBytes(size, amount_units, true);
+ std::wstring received_size = UTF16ToWideHack(FormatBytes(size, amount_units,
+ true));
std::wstring amount = received_size;
// Adjust both strings for the locale direction since we don't yet know which
@@ -604,7 +605,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
if (total) {
amount_units = GetByteDisplayUnits(total);
- std::wstring total_text = FormatBytes(total, amount_units, true);
+ std::wstring total_text =
+ UTF16ToWideHack(FormatBytes(total, amount_units, true));
std::wstring total_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(total_text,
&total_text_localized))
@@ -617,8 +619,9 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
amount.assign(received_size);
}
amount_units = GetByteDisplayUnits(download->CurrentSpeed());
- std::wstring speed_text = FormatSpeed(download->CurrentSpeed(),
- amount_units, true);
+ std::wstring speed_text =
+ UTF16ToWideHack(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 359cdca..5ecba7e 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_),
- WideToUTF8(FormatBytes(
+ UTF16ToUTF8(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_),
- WideToUTF8(FormatBytes(
+ UTF16ToUTF8(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_),
- WideToUTF8(FormatBytes(
+ UTF16ToUTF8(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_),
- WideToUTF8(FormatBytes(
+ UTF16ToUTF8(FormatBytes(
estimated_size,
GetByteDisplayUnits(estimated_size),
true)).c_str());
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
}