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

Side by Side Diff: components/autofill/core/common/autofill_l10n_util.cc

Issue 1505763002: Use generic icu:: prefix instead of icu_54:: in autofill_l10n_util.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/common/autofill_l10n_util.h" 5 #include "components/autofill/core/common/autofill_l10n_util.h"
6 6
7 #include "base/i18n/string_compare.h" 7 #include "base/i18n/string_compare.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 10
11 namespace autofill { 11 namespace autofill {
12 namespace l10n { 12 namespace l10n {
13 13
14 CaseInsensitiveCompare::CaseInsensitiveCompare() 14 CaseInsensitiveCompare::CaseInsensitiveCompare()
15 : CaseInsensitiveCompare(icu::Locale::getDefault()) {} 15 : CaseInsensitiveCompare(icu::Locale::getDefault()) {}
16 16
17 CaseInsensitiveCompare::CaseInsensitiveCompare(const icu::Locale& locale) { 17 CaseInsensitiveCompare::CaseInsensitiveCompare(const icu::Locale& locale) {
18 UErrorCode error = U_ZERO_ERROR; 18 UErrorCode error = U_ZERO_ERROR;
19 collator_.reset(icu::Collator::createInstance(locale, error)); 19 collator_.reset(icu::Collator::createInstance(locale, error));
20 if (!collator_) { 20 if (!collator_) {
21 // On some systems, the default locale is invalid to the eyes of the ICU 21 // On some systems, the default locale is invalid to the eyes of the ICU
22 // library. This could be due to a device-specific issue (has been seen in 22 // library. This could be due to a device-specific issue (has been seen in
23 // the wild on Android devices). In the failure case, |collator_| will be 23 // the wild on Android devices). In the failure case, |collator_| will be
24 // null. See http://crbug.com/558625. 24 // null. See http://crbug.com/558625.
25 icu_54::UnicodeString name; 25 icu::UnicodeString name;
26 std::string locale_name; 26 std::string locale_name;
27 locale.getDisplayName(name).toUTF8String(locale_name); 27 locale.getDisplayName(name).toUTF8String(locale_name);
28 LOG(ERROR) << "Failed to initialize the ICU Collator for " 28 LOG(ERROR) << "Failed to initialize the ICU Collator for "
29 << "CaseInsensitiveCompare with locale" << locale_name; 29 << "CaseInsensitiveCompare with locale" << locale_name;
30 // Attempt to load the English locale. 30 // Attempt to load the English locale.
31 collator_.reset(icu::Collator::createInstance(icu::Locale::getEnglish(), 31 collator_.reset(icu::Collator::createInstance(icu::Locale::getEnglish(),
32 error)); 32 error));
33 } 33 }
34 34
35 if (collator_) { 35 if (collator_) {
(...skipping 12 matching lines...) Expand all
48 const base::string16& rhs) const { 48 const base::string16& rhs) const {
49 if (collator_) { 49 if (collator_) {
50 return base::i18n::CompareString16WithCollator(*collator_, lhs, rhs) == 50 return base::i18n::CompareString16WithCollator(*collator_, lhs, rhs) ==
51 UCOL_EQUAL; 51 UCOL_EQUAL;
52 } 52 }
53 return lhs == rhs; 53 return lhs == rhs;
54 } 54 }
55 55
56 } // namespace l10n 56 } // namespace l10n
57 } // namespace autofill 57 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698