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

Unified Diff: app/l10n_util.cc

Issue 171012: Use 'icu::' namespace explicitly (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « app/l10n_util.h ('k') | app/l10n_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/l10n_util.cc
===================================================================
--- app/l10n_util.cc (revision 23559)
+++ app/l10n_util.cc (working copy)
@@ -45,7 +45,7 @@
// it's not affected by ICU's default locale. It's all right
// to do this way because SetICUDefaultLocale is internal
// to this file and we know where/when it's called.
- Locale locale = Locale::getDefault();
+ icu::Locale locale = icu::Locale::getDefault();
const char* language = locale.getLanguage();
const char* country = locale.getCountry();
DCHECK(language);
@@ -89,9 +89,9 @@
// everytime we call locale-dependent ICU APIs as long as we make sure
// that this is called before any locale-dependent API is called.
UBool SetICUDefaultLocale(const std::string& locale_string) {
- Locale locale(ICULocaleName(locale_string).c_str());
+ icu::Locale locale(ICULocaleName(locale_string).c_str());
UErrorCode error_code = U_ZERO_ERROR;
- Locale::setDefault(locale, error_code);
+ icu::Locale::setDefault(locale, error_code);
// This return value is actually bogus because Locale object is
// an ID and setDefault seems to always succeed (regardless of the
// presence of actual locale data). However,
@@ -455,19 +455,20 @@
#endif
// Use a line iterator to find the first boundary.
UErrorCode status = U_ZERO_ERROR;
- scoped_ptr<RuleBasedBreakIterator> bi(static_cast<RuleBasedBreakIterator*>(
- RuleBasedBreakIterator::createLineInstance(Locale::getDefault(),
- status)));
+ scoped_ptr<icu::RuleBasedBreakIterator> bi(
+ static_cast<icu::RuleBasedBreakIterator*>(
+ icu::RuleBasedBreakIterator::createLineInstance(
+ icu::Locale::getDefault(), status)));
if (U_FAILURE(status))
return string.substr(0, max) + kElideString;
bi->setText(string_utf16.c_str());
int32_t index = bi->preceding(static_cast<int32_t>(max));
- if (index == BreakIterator::DONE) {
+ if (index == icu::BreakIterator::DONE) {
index = static_cast<int32_t>(max);
} else {
// Found a valid break (may be the beginning of the string). Now use
// a character iterator to find the previous non-whitespace character.
- StringCharacterIterator char_iterator(string_utf16.c_str());
+ icu::StringCharacterIterator char_iterator(string_utf16.c_str());
if (index == 0) {
// No valid line breaks. Start at the end again. This ensures we break
// on a valid character boundary.
@@ -503,8 +504,8 @@
#endif // defined(WCHAR_T_IS_UTF32)
string16 ToLower(const string16& string) {
- UnicodeString lower_u_str(
- UnicodeString(string.c_str()).toLower(Locale::getDefault()));
+ icu::UnicodeString lower_u_str(
+ icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault()));
string16 result;
lower_u_str.extract(0, lower_u_str.length(),
WriteInto(&result, lower_u_str.length() + 1));
@@ -521,7 +522,7 @@
g_text_direction =
(gtk_dir == GTK_TEXT_DIR_LTR) ? LEFT_TO_RIGHT : RIGHT_TO_LEFT;
#else
- const Locale& locale = Locale::getDefault();
+ const icu::Locale& locale = icu::Locale::getDefault();
g_text_direction = GetTextDirectionForLocale(locale.getName());
#endif
}
@@ -668,7 +669,7 @@
// Compares the character data stored in two different strings by specified
// Collator instance.
-UCollationResult CompareStringWithCollator(const Collator* collator,
+UCollationResult CompareStringWithCollator(const icu::Collator* collator,
const std::wstring& lhs,
const std::wstring& rhs) {
DCHECK(collator);
« no previous file with comments | « app/l10n_util.h ('k') | app/l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698