diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 15:08:08 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-22 15:08:08 +0000 |
commit | 1b6dc3e04f3438ab25faff315890bc82e82a262a (patch) | |
tree | c1528eda75d2bfa70ae68d111b65d38920085c15 | |
parent | b81af210441caf958d664a7abc62050f009e464e (diff) | |
download | chromium_src-1b6dc3e04f3438ab25faff315890bc82e82a262a.zip chromium_src-1b6dc3e04f3438ab25faff315890bc82e82a262a.tar.gz chromium_src-1b6dc3e04f3438ab25faff315890bc82e82a262a.tar.bz2 |
Update the time formatting APIs to use string16.
BUG=23581
TEST=everything still works
Review URL: http://codereview.chromium.org/6064003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69948 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/i18n/time_formatting.cc | 23 | ||||
-rw-r--r-- | base/i18n/time_formatting.h | 14 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_html_writer_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/certificate_manager_model.cc | 6 | ||||
-rw-r--r-- | chrome/browser/dom_ui/history2_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/dom_ui/history_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/dom_ui/options/cookies_view_handler.cc | 14 | ||||
-rw-r--r-- | chrome/browser/download/download_util.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/certificate_viewer.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_chrome_cookie_view.cc | 14 | ||||
-rw-r--r-- | chrome/browser/gtk/ssl_client_certificate_selector.cc | 8 | ||||
-rw-r--r-- | chrome/browser/page_info_model.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sync/sync_ui_util.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/cookie_details.mm | 14 | ||||
-rw-r--r-- | net/base/net_util.cc | 2 | ||||
-rw-r--r-- | printing/printed_document_posix.cc | 4 | ||||
-rw-r--r-- | webkit/appcache/view_appcache_internals_job.cc | 8 | ||||
-rw-r--r-- | webkit/blob/view_blob_internals_job.cc | 2 |
18 files changed, 68 insertions, 82 deletions
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc index 406145d..3fa984a 100644 --- a/base/i18n/time_formatting.cc +++ b/base/i18n/time_formatting.cc @@ -14,24 +14,21 @@ using base::Time; namespace { -std::wstring TimeFormat(const icu::DateFormat* formatter, - const Time& time) { +string16 TimeFormat(const icu::DateFormat* formatter, + const Time& time) { DCHECK(formatter); icu::UnicodeString date_string; formatter->format(static_cast<UDate>(time.ToDoubleT() * 1000), date_string); - std::wstring output; - bool success = UTF16ToWide(date_string.getBuffer(), date_string.length(), - &output); - DCHECK(success); - return output; + return string16(date_string.getBuffer(), + static_cast<size_t>(date_string.length())); } } // namespace namespace base { -std::wstring TimeFormatTimeOfDay(const Time& time) { +string16 TimeFormatTimeOfDay(const Time& time) { // We can omit the locale parameter because the default should match // Chrome's application locale. scoped_ptr<icu::DateFormat> formatter( @@ -39,31 +36,31 @@ std::wstring TimeFormatTimeOfDay(const Time& time) { return TimeFormat(formatter.get(), time); } -std::wstring TimeFormatShortDate(const Time& time) { +string16 TimeFormatShortDate(const Time& time) { scoped_ptr<icu::DateFormat> formatter( icu::DateFormat::createDateInstance(icu::DateFormat::kMedium)); return TimeFormat(formatter.get(), time); } -std::wstring TimeFormatShortDateNumeric(const Time& time) { +string16 TimeFormatShortDateNumeric(const Time& time) { scoped_ptr<icu::DateFormat> formatter( icu::DateFormat::createDateInstance(icu::DateFormat::kShort)); return TimeFormat(formatter.get(), time); } -std::wstring TimeFormatShortDateAndTime(const Time& time) { +string16 TimeFormatShortDateAndTime(const Time& time) { scoped_ptr<icu::DateFormat> formatter( icu::DateFormat::createDateTimeInstance(icu::DateFormat::kShort)); return TimeFormat(formatter.get(), time); } -std::wstring TimeFormatFriendlyDateAndTime(const Time& time) { +string16 TimeFormatFriendlyDateAndTime(const Time& time) { scoped_ptr<icu::DateFormat> formatter( icu::DateFormat::createDateTimeInstance(icu::DateFormat::kFull)); return TimeFormat(formatter.get(), time); } -std::wstring TimeFormatFriendlyDate(const Time& time) { +string16 TimeFormatFriendlyDate(const Time& time) { scoped_ptr<icu::DateFormat> formatter(icu::DateFormat::createDateInstance( icu::DateFormat::kFull)); return TimeFormat(formatter.get(), time); diff --git a/base/i18n/time_formatting.h b/base/i18n/time_formatting.h index d78ae9b..e70ad3d 100644 --- a/base/i18n/time_formatting.h +++ b/base/i18n/time_formatting.h @@ -9,32 +9,32 @@ #define BASE_I18N_TIME_FORMATTING_H_ #pragma once -#include <string> +#include "base/string16.h" namespace base { class Time; // Returns the time of day, e.g., "3:07 PM". -std::wstring TimeFormatTimeOfDay(const Time& time); +string16 TimeFormatTimeOfDay(const Time& time); // Returns a shortened date, e.g. "Nov 7, 2007" -std::wstring TimeFormatShortDate(const Time& time); +string16 TimeFormatShortDate(const Time& time); // Returns a numeric date such as 12/13/52. -std::wstring TimeFormatShortDateNumeric(const Time& time); +string16 TimeFormatShortDateNumeric(const Time& time); // Formats a time in a friendly sentence format, e.g. // "Monday, March 6, 2008 2:44:30 PM". -std::wstring TimeFormatShortDateAndTime(const Time& time); +string16 TimeFormatShortDateAndTime(const Time& time); // Formats a time in a friendly sentence format, e.g. // "Monday, March 6, 2008 2:44:30 PM". -std::wstring TimeFormatFriendlyDateAndTime(const Time& time); +string16 TimeFormatFriendlyDateAndTime(const Time& time); // Formats a time in a friendly sentence format, e.g. // "Monday, March 6, 2008". -std::wstring TimeFormatFriendlyDate(const Time& time); +string16 TimeFormatFriendlyDate(const Time& time); } // namespace base diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc index 2394f76..3a0bcbf 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc @@ -75,8 +75,7 @@ class BookmarkHTMLWriterTest : public testing::Test { result.append(WideToUTF16Hack(entry.title)); result.append(ASCIIToUTF16(" time=")); - result.append(WideToUTF16Hack( - base::TimeFormatFriendlyDateAndTime(entry.creation_time))); + result.append(base::TimeFormatFriendlyDateAndTime(entry.creation_time)); return result; } diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc index 1c7cd4e..619260e 100644 --- a/chrome/browser/certificate_manager_model.cc +++ b/chrome/browser/certificate_manager_model.cc @@ -65,10 +65,8 @@ string16 CertificateManagerModel::GetColumnText( cert.os_cert_handle(), "")); break; case COL_EXPIRES_ON: - if (!cert.valid_expiry().is_null()) { - rv = WideToUTF16Hack( - base::TimeFormatShortDateNumeric(cert.valid_expiry())); - } + if (!cert.valid_expiry().is_null()) + rv = base::TimeFormatShortDateNumeric(cert.valid_expiry()); break; default: NOTREACHED(); diff --git a/chrome/browser/dom_ui/history2_ui.cc b/chrome/browser/dom_ui/history2_ui.cc index 0e72376..faf00cb 100644 --- a/chrome/browser/dom_ui/history2_ui.cc +++ b/chrome/browser/dom_ui/history2_ui.cc @@ -276,20 +276,19 @@ void BrowsingHistoryHandler2::QueryComplete( string16 date_str = TimeFormat::RelativeDate(page.visit_time(), &midnight_today); if (date_str.empty()) { - date_str = - WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time())); + date_str = base::TimeFormatFriendlyDate(page.visit_time()); } else { date_str = l10n_util::GetStringFUTF16( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, date_str, - WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time()))); + base::TimeFormatFriendlyDate(page.visit_time())); } page_value->SetString("dateRelativeDay", date_str); page_value->SetString("dateTimeOfDay", - WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time()))); + base::TimeFormatTimeOfDay(page.visit_time())); } else { page_value->SetString("dateShort", - WideToUTF16Hack(base::TimeFormatShortDate(page.visit_time()))); + base::TimeFormatShortDate(page.visit_time())); page_value->SetString("snippet", page.snippet().text()); } page_value->SetBoolean("starred", diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index 23581c9..fa7c332 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -276,20 +276,19 @@ void BrowsingHistoryHandler::QueryComplete( string16 date_str = TimeFormat::RelativeDate(page.visit_time(), &midnight_today); if (date_str.empty()) { - date_str = - WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time())); + date_str = base::TimeFormatFriendlyDate(page.visit_time()); } else { date_str = l10n_util::GetStringFUTF16( IDS_HISTORY_DATE_WITH_RELATIVE_TIME, date_str, - WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time()))); + base::TimeFormatFriendlyDate(page.visit_time())); } page_value->SetString("dateRelativeDay", date_str); page_value->SetString("dateTimeOfDay", - WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time()))); + base::TimeFormatTimeOfDay(page.visit_time())); } else { page_value->SetString("dateShort", - WideToUTF16Hack(base::TimeFormatShortDate(page.visit_time()))); + base::TimeFormatShortDate(page.visit_time())); page_value->SetString("snippet", page.snippet().text()); } page_value->SetBoolean("starred", diff --git a/chrome/browser/dom_ui/options/cookies_view_handler.cc b/chrome/browser/dom_ui/options/cookies_view_handler.cc index 67a10ad..5cfeb7a 100644 --- a/chrome/browser/dom_ui/options/cookies_view_handler.cc +++ b/chrome/browser/dom_ui/options/cookies_view_handler.cc @@ -85,9 +85,9 @@ void GetCookieTreeNodeDictionary(const CookieTreeNode& node, dict->SetString(kKeySendFor, cookie.IsSecure() ? l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_SENDFOR_ANY)); - dict->SetString(kKeyCreated, WideToUTF8( + dict->SetString(kKeyCreated, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(cookie.CreationDate()))); - dict->SetString(kKeyExpires, cookie.DoesExpire() ? WideToUTF8( + dict->SetString(kKeyExpires, cookie.DoesExpire() ? UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION)); @@ -108,7 +108,7 @@ void GetCookieTreeNodeDictionary(const CookieTreeNode& node, FormatBytes(database_info.size, GetByteDisplayUnits(database_info.size), true)); - dict->SetString(kKeyModified, WideToUTF8( + dict->SetString(kKeyModified, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(database_info.last_modified))); break; @@ -125,7 +125,7 @@ void GetCookieTreeNodeDictionary(const CookieTreeNode& node, FormatBytes(local_storage_info.size, GetByteDisplayUnits(local_storage_info.size), true)); - dict->SetString(kKeyModified, WideToUTF8( + dict->SetString(kKeyModified, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime( local_storage_info.last_modified))); @@ -143,9 +143,9 @@ void GetCookieTreeNodeDictionary(const CookieTreeNode& node, FormatBytes(appcache_info.size, GetByteDisplayUnits(appcache_info.size), true)); - dict->SetString(kKeyCreated, WideToUTF8( + dict->SetString(kKeyCreated, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(appcache_info.creation_time))); - dict->SetString(kKeyAccessed, WideToUTF8( + dict->SetString(kKeyAccessed, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(appcache_info.last_access_time))); break; @@ -162,7 +162,7 @@ void GetCookieTreeNodeDictionary(const CookieTreeNode& node, FormatBytes(indexed_db_info.size, GetByteDisplayUnits(indexed_db_info.size), true)); - dict->SetString(kKeyModified, WideToUTF8( + dict->SetString(kKeyModified, UTF16ToUTF8( base::TimeFormatFriendlyDateAndTime(indexed_db_info.last_modified))); break; diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 70514e3..c46ece3 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -489,7 +489,7 @@ DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) { file_value->SetString("since_string", TimeFormat::RelativeDate(download->start_time(), NULL)); file_value->SetString("date_string", - WideToUTF16Hack(base::TimeFormatShortDate(download->start_time()))); + base::TimeFormatShortDate(download->start_time())); file_value->SetInteger("id", id); file_value->SetString("file_path", WideToUTF16Hack(download->GetTargetFilePath().ToWStringHack())); diff --git a/chrome/browser/gtk/certificate_viewer.cc b/chrome/browser/gtk/certificate_viewer.cc index 905eee3..a79507d 100644 --- a/chrome/browser/gtk/certificate_viewer.cc +++ b/chrome/browser/gtk/certificate_viewer.cc @@ -260,9 +260,9 @@ void CertificateViewer::InitGeneralPage() { base::Time issued, expires; std::string issued_str, expires_str; if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { - issued_str = WideToUTF8( + issued_str = UTF16ToUTF8( base::TimeFormatShortDateNumeric(issued)); - expires_str = WideToUTF8( + expires_str = UTF16ToUTF8( base::TimeFormatShortDateNumeric(expires)); } else { issued_str = alternative_text; @@ -389,8 +389,8 @@ void CertificateViewer::FillTreeStoreWithCertFields( base::Time issued, expires; std::string issued_str, expires_str; if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { - issued_str = WideToUTF8(base::TimeFormatShortDateAndTime(issued)); - expires_str = WideToUTF8(base::TimeFormatShortDateAndTime(expires)); + issued_str = UTF16ToUTF8(base::TimeFormatShortDateAndTime(issued)); + expires_str = UTF16ToUTF8(base::TimeFormatShortDateAndTime(expires)); } gtk_tree_store_append(store, &iter, &validity_iter); gtk_tree_store_set( diff --git a/chrome/browser/gtk/gtk_chrome_cookie_view.cc b/chrome/browser/gtk/gtk_chrome_cookie_view.cc index 07413f6..a0e3c62 100644 --- a/chrome/browser/gtk/gtk_chrome_cookie_view.cc +++ b/chrome/browser/gtk/gtk_chrome_cookie_view.cc @@ -474,11 +474,11 @@ void gtk_chrome_cookie_view_display_cookie( gtk_entry_set_text(GTK_ENTRY(self->cookie_path_entry_), cookie.Path().c_str()); gtk_entry_set_text(GTK_ENTRY(self->cookie_created_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( cookie.CreationDate())).c_str()); std::string expire_text = cookie.DoesExpire() ? - WideToUTF8(base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate())) : l10n_util::GetStringUTF8(IDS_COOKIES_COOKIE_EXPIRES_SESSION); if (self->cookie_expires_entry_) { @@ -545,7 +545,7 @@ void gtk_chrome_cookie_view_display_database( GetByteDisplayUnits(database_info.size), true)).c_str()); gtk_entry_set_text(GTK_ENTRY(self->database_last_modified_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( database_info.last_modified)).c_str()); SetDatabaseDetailsSensitivity(self, TRUE); } @@ -565,7 +565,7 @@ void gtk_chrome_cookie_view_display_local_storage( GetByteDisplayUnits(local_storage_info.size), true)).c_str()); gtk_entry_set_text(GTK_ENTRY(self->local_storage_last_modified_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( local_storage_info.last_modified)).c_str()); SetLocalStorageDetailsSensitivity(self, TRUE); } @@ -584,10 +584,10 @@ void gtk_chrome_cookie_view_display_app_cache( GetByteDisplayUnits(info.size), true)).c_str()); gtk_entry_set_text(GTK_ENTRY(self->appcache_created_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( info.creation_time)).c_str()); gtk_entry_set_text(GTK_ENTRY(self->appcache_last_accessed_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( info.last_access_time)).c_str()); SetAppCacheDetailsSensitivity(self, TRUE); } @@ -606,7 +606,7 @@ void gtk_chrome_cookie_view_display_indexed_db( GetByteDisplayUnits(indexed_db_info.size), true)).c_str()); gtk_entry_set_text(GTK_ENTRY(self->indexed_db_last_modified_entry_), - WideToUTF8(base::TimeFormatFriendlyDateAndTime( + UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime( indexed_db_info.last_modified)).c_str()); SetLocalStorageDetailsSensitivity(self, TRUE); } diff --git a/chrome/browser/gtk/ssl_client_certificate_selector.cc b/chrome/browser/gtk/ssl_client_certificate_selector.cc index 8e4077e..edf560a 100644 --- a/chrome/browser/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/gtk/ssl_client_certificate_selector.cc @@ -246,7 +246,7 @@ std::string SSLClientCertificateSelector::FormatDetailsText( rv += l10n_util::GetStringFUTF8( IDS_CERT_SUBJECTNAME_FORMAT, - UTF8ToUTF16(x509_certificate_model::GetSubjectName(cert)));; + UTF8ToUTF16(x509_certificate_model::GetSubjectName(cert))); rv += "\n "; rv += l10n_util::GetStringFUTF8( @@ -256,10 +256,8 @@ std::string SSLClientCertificateSelector::FormatDetailsText( base::Time issued, expires; if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { - string16 issued_str = WideToUTF16( - base::TimeFormatShortDateAndTime(issued)); - string16 expires_str = WideToUTF16( - base::TimeFormatShortDateAndTime(expires)); + string16 issued_str = base::TimeFormatShortDateAndTime(issued); + string16 expires_str = base::TimeFormatShortDateAndTime(expires); rv += "\n "; rv += l10n_util::GetStringFUTF8(IDS_CERT_VALIDITY_RANGE_FORMAT, issued_str, expires_str); diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index cba7dd3..750c45b 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -329,7 +329,7 @@ void PageInfoModel::OnGotVisitCountToHost(HistoryService::Handle handle, headline, l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, - WideToUTF16(base::TimeFormatShortDate(first_visit))), + base::TimeFormatShortDate(first_visit)), SECTION_INFO_FIRST_VISIT)); } observer_->ModelChanged(); diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 30a4ed4..27fdb9a 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -217,12 +217,12 @@ void AddIntSyncDetail(ListValue* details, const std::string& stat_name, details->Append(val); } -std::wstring ConstructTime(int64 time_in_int) { +string16 ConstructTime(int64 time_in_int) { base::Time time = base::Time::FromInternalValue(time_in_int); // If time is null the format function returns a time in 1969. if (time.is_null()) - return std::wstring(); + return string16(); return base::TimeFormatFriendlyDateAndTime(time); } @@ -354,9 +354,7 @@ void ConstructAboutInformation(ProfileSyncService* service, DictionaryValue* val = new DictionaryValue; val->SetString("stat_name", "Autofill Migration Time"); - val->SetString("stat_value", - WideToUTF16Hack( - ConstructTime(info.autofill_migration_time))); + val->SetString("stat_value", ConstructTime(info.autofill_migration_time)); details->Append(val); } } diff --git a/chrome/browser/ui/cocoa/cookie_details.mm b/chrome/browser/ui/cocoa/cookie_details.mm index c6f5cec..e88cf27 100644 --- a/chrome/browser/ui/cocoa/cookie_details.mm +++ b/chrome/browser/ui/cocoa/cookie_details.mm @@ -128,14 +128,14 @@ domain_.reset([origin retain]); if (cookie->DoesExpire()) { - expires_.reset([base::SysWideToNSString( + expires_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime(cookie->ExpiryDate())) retain]); } else { expires_.reset([l10n_util::GetNSStringWithFixup( IDS_COOKIES_COOKIE_EXPIRES_SESSION) retain]); } - created_.reset([base::SysWideToNSString( + created_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime(cookie->CreationDate())) retain]); if (cookie->IsSecure()) { @@ -158,7 +158,7 @@ databaseInfo->description) retain]); fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(databaseInfo->size, GetByteDisplayUnits(databaseInfo->size), true)) retain]); - lastModified_.reset([base::SysWideToNSString( + lastModified_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime( databaseInfo->last_modified)) retain]); } @@ -173,7 +173,7 @@ domain_.reset([base::SysUTF8ToNSString(storageInfo->origin) retain]); fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(storageInfo->size, GetByteDisplayUnits(storageInfo->size), true)) retain]); - lastModified_.reset([base::SysWideToNSString( + lastModified_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime( storageInfo->last_modified)) retain]); } @@ -188,10 +188,10 @@ appcacheInfo->manifest_url.spec()) retain]); fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(appcacheInfo->size, GetByteDisplayUnits(appcacheInfo->size), true)) retain]); - created_.reset([base::SysWideToNSString( + created_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime( appcacheInfo->creation_time)) retain]); - lastAccessed_.reset([base::SysWideToNSString( + lastAccessed_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime( appcacheInfo->last_access_time)) retain]); } @@ -245,7 +245,7 @@ domain_.reset([base::SysUTF8ToNSString(indexedDBInfo->origin) retain]); fileSize_.reset([base::SysUTF16ToNSString(FormatBytes(indexedDBInfo->size, GetByteDisplayUnits(indexedDBInfo->size), true)) retain]); - lastModified_.reset([base::SysWideToNSString( + lastModified_.reset([base::SysUTF16ToNSString( base::TimeFormatFriendlyDateAndTime( indexedDBInfo->last_modified)) retain]); } diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 4f6e361..b4b0226 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1362,7 +1362,7 @@ std::string GetDirectoryListingEntry(const string16& name, string16 modified_str; // |modified| can be NULL in FTP listings. if (!modified.is_null()) { - modified_str = WideToUTF16Hack(base::TimeFormatShortDateAndTime(modified)); + modified_str = base::TimeFormatShortDateAndTime(modified); } base::JsonDoubleQuote(modified_str, true, &result); diff --git a/printing/printed_document_posix.cc b/printing/printed_document_posix.cc index 9a37f2c..33c0264 100644 --- a/printing/printed_document_posix.cc +++ b/printing/printed_document_posix.cc @@ -14,8 +14,8 @@ namespace printing { void PrintedDocument::Immutable::SetDocumentDate() { Time now = Time::Now(); - date_ = WideToUTF16Hack(base::TimeFormatShortDateNumeric(now)); - time_ = WideToUTF16Hack(base::TimeFormatTimeOfDay(now)); + date_ = base::TimeFormatShortDateNumeric(now); + time_ = base::TimeFormatTimeOfDay(now); } } // namespace printing diff --git a/webkit/appcache/view_appcache_internals_job.cc b/webkit/appcache/view_appcache_internals_job.cc index 12a2ab6..b4874db 100644 --- a/webkit/appcache/view_appcache_internals_job.cc +++ b/webkit/appcache/view_appcache_internals_job.cc @@ -113,15 +113,13 @@ void AddHTMLFromAppCacheToOutput( info->size, GetByteDisplayUnits(info->size), true)), out); AddLiTag(kCreationTime, - WideToUTF8(TimeFormatFriendlyDateAndTime( - info->creation_time)), + UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->creation_time)), out); AddLiTag(kLastAccessTime, - WideToUTF8( - TimeFormatFriendlyDateAndTime(info->last_access_time)), + UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_access_time)), out); AddLiTag(kLastUpdateTime, - WideToUTF8(TimeFormatFriendlyDateAndTime(info->last_update_time)), + UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_update_time)), out); out->append("</ul></p></br>"); diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc index 6c91f54..eceb5cd 100644 --- a/webkit/blob/view_blob_internals_job.cc +++ b/webkit/blob/view_blob_internals_job.cc @@ -210,7 +210,7 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, #endif out); if (!item.expected_modification_time().is_null()) { - AddHTMLListItem(kModificationTime, WideToUTF8( + AddHTMLListItem(kModificationTime, UTF16ToUTF8( TimeFormatFriendlyDateAndTime(item.expected_modification_time())), out); } |