Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3702)

Unified Diff: chrome/browser/dom_ui/history_ui.cc

Issue 3165009: Convert TimeFormat (chrome/common/time_format.*) to string16 (from wstring). (Closed)
Patch Set: bar Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/history2_ui.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/history_ui.cc
diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc
index bd1ec3cd913e5fc0c831e6644ddb15572253ce32..be095424d93dc11c412ff6235eb9e972e54b8d27 100644
--- a/chrome/browser/dom_ui/history_ui.cc
+++ b/chrome/browser/dom_ui/history_ui.cc
@@ -10,10 +10,12 @@
#include "base/i18n/time_formatting.h"
#include "base/message_loop.h"
#include "base/singleton.h"
+#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
#include "base/thread.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser.h"
@@ -263,16 +265,18 @@ void BrowsingHistoryHandler::QueryComplete(
// and snippet, browse results need day and time information).
if (search_text_.empty()) {
// Figure out the relative date string.
- std::wstring date_str = TimeFormat::RelativeDate(page.visit_time(),
- &midnight_today);
+ string16 date_str = TimeFormat::RelativeDate(page.visit_time(),
+ &midnight_today);
if (date_str.empty()) {
- date_str = base::TimeFormatFriendlyDate(page.visit_time());
+ date_str =
+ WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time()));
} else {
- date_str = l10n_util::GetStringF(
+ date_str = l10n_util::GetStringFUTF16(
IDS_HISTORY_DATE_WITH_RELATIVE_TIME,
- date_str, base::TimeFormatFriendlyDate(page.visit_time()));
+ date_str,
+ WideToUTF16Hack(base::TimeFormatFriendlyDate(page.visit_time())));
}
- page_value->SetString("dateRelativeDay", WideToUTF16Hack(date_str));
+ page_value->SetString("dateRelativeDay", date_str);
page_value->SetString("dateTimeOfDay",
WideToUTF16Hack(base::TimeFormatTimeOfDay(page.visit_time())));
} else {
« no previous file with comments | « chrome/browser/dom_ui/history2_ui.cc ('k') | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698