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
3 // found in the LICENSE file.
5 #include "components/autofill/core/common/autofill_l10n_util.h"
7 #include "base/i18n/string_compare.h"
8 #include "base/logging.h"
13 CaseInsensitiveCompare::CaseInsensitiveCompare() {
14 UErrorCode error
= U_ZERO_ERROR
;
15 collator_
.reset(icu::Collator::createInstance(error
));
16 DCHECK(U_SUCCESS(error
));
17 collator_
->setStrength(icu::Collator::PRIMARY
);
20 CaseInsensitiveCompare::~CaseInsensitiveCompare() {
23 bool CaseInsensitiveCompare::StringsEqual(const base::string16
& lhs
,
24 const base::string16
& rhs
) const {
25 return base::i18n::CompareString16WithCollator(*collator_
, lhs
, rhs
) ==
30 } // namespace autofill