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

Unified Diff: chrome/browser/dom_ui/history2_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/chromeos/low_battery_observer.cc ('k') | chrome/browser/dom_ui/history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/history2_ui.cc
diff --git a/chrome/browser/dom_ui/history2_ui.cc b/chrome/browser/dom_ui/history2_ui.cc
index b06aceb793bb24c598ab7ab2a625fedbd0a9be02..d808fe9f8fec5eab1fd8aabaa785a7b305a64416 100644
--- a/chrome/browser/dom_ui/history2_ui.cc
+++ b/chrome/browser/dom_ui/history2_ui.cc
@@ -10,8 +10,10 @@
#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/utf_string_conversions.h"
#include "base/thread.h"
#include "base/time.h"
#include "base/values.h"
@@ -263,16 +265,18 @@ void BrowsingHistoryHandler2::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/chromeos/low_battery_observer.cc ('k') | chrome/browser/dom_ui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698