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

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

Issue 1457393003: [Autofill] Guard against the initialization failure of ICU Collator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UBool 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
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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/string16.h" 6 #include "base/strings/string16.h"
7 #include "third_party/icu/source/common/unicode/locid.h"
7 #include "third_party/icu/source/i18n/unicode/coll.h" 8 #include "third_party/icu/source/i18n/unicode/coll.h"
8 9
9 namespace autofill { 10 namespace autofill {
10 namespace l10n { 11 namespace l10n {
11 12
12 // Assists with locale-aware case insensitive string comparisons. 13 // Assists with locale-aware case insensitive string comparisons.
13 class CaseInsensitiveCompare { 14 class CaseInsensitiveCompare {
14 public: 15 public:
15 CaseInsensitiveCompare(); 16 CaseInsensitiveCompare();
17 // Used for testing.
18 explicit CaseInsensitiveCompare(const icu::Locale& locale);
16 ~CaseInsensitiveCompare(); 19 ~CaseInsensitiveCompare();
17 20
18 bool StringsEqual(const base::string16& lhs, const base::string16& rhs) const; 21 bool StringsEqual(const base::string16& lhs, const base::string16& rhs) const;
19 22
20 private: 23 private:
21 scoped_ptr<icu::Collator> collator_; 24 scoped_ptr<icu::Collator> collator_;
22 25
23 DISALLOW_COPY_AND_ASSIGN(CaseInsensitiveCompare); 26 DISALLOW_COPY_AND_ASSIGN(CaseInsensitiveCompare);
24 }; 27 };
25 28
26 } // namespace l10n 29 } // namespace l10n
27 } // namespace autofill 30 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698