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

Unified Diff: chrome/common/time_format.cc

Issue 10255: Port some files in chrome/common to Linux.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 1 month 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/common/pref_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/time_format.cc
===================================================================
--- chrome/common/time_format.cc (revision 5823)
+++ chrome/common/time_format.cc (working copy)
@@ -40,8 +40,8 @@
STLDeleteContainerPointers(long_formatter_.begin(),
long_formatter_.end());
}
- friend Singleton<TimeRemainingFormat>;
- friend DefaultSingletonTraits<TimeRemainingFormat>;
+ friend class Singleton<TimeRemainingFormat>;
+ friend struct DefaultSingletonTraits<TimeRemainingFormat>;
std::vector<PluralFormat*> long_formatter_;
std::vector<PluralFormat*> short_formatter_;
@@ -116,7 +116,7 @@
}
for (int i = 0; i < 4; ++i) {
UnicodeString pattern;
- for (int j = 0; j < arraysize(kKeywords); ++j) {
+ for (size_t j = 0; j < arraysize(kKeywords); ++j) {
int msg_id = short_version ? kTimeMsgIds[i][j] : kTimeLeftMsgIds[i][j];
if (msg_id == kInvalidMsgId) continue;
std::string sub_pattern = WideToUTF8(l10n_util::GetString(msg_id));
@@ -213,11 +213,12 @@
// With the fallback added, this should never fail.
DCHECK(U_SUCCESS(error));
int capacity = time_string.length() + 1;
- std::wstring formatted;
- time_string.extract(static_cast<UChar*>(WriteInto(&formatted, capacity)),
+ string16 result_utf16;
+ time_string.extract(static_cast<UChar*>(
+ WriteInto(&result_utf16, capacity)),
capacity, error);
DCHECK(U_SUCCESS(error));
- return formatted;
+ return UTF16ToWide(result_utf16);
}
// static
« no previous file with comments | « chrome/common/pref_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698