OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/autofill_country.h" | 5 #include "components/autofill/browser/autofill_country.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/threading/thread_checker.h" | |
18 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
20 #include "third_party/icu/public/common/unicode/locid.h" | 19 #include "third_party/icu/public/common/unicode/locid.h" |
21 #include "third_party/icu/public/common/unicode/uloc.h" | 20 #include "third_party/icu/public/common/unicode/uloc.h" |
22 #include "third_party/icu/public/common/unicode/unistr.h" | 21 #include "third_party/icu/public/common/unicode/unistr.h" |
23 #include "third_party/icu/public/common/unicode/urename.h" | 22 #include "third_party/icu/public/common/unicode/urename.h" |
24 #include "third_party/icu/public/common/unicode/utypes.h" | 23 #include "third_party/icu/public/common/unicode/utypes.h" |
25 #include "third_party/icu/public/i18n/unicode/coll.h" | 24 #include "third_party/icu/public/i18n/unicode/coll.h" |
26 #include "third_party/icu/public/i18n/unicode/ucol.h" | 25 #include "third_party/icu/public/i18n/unicode/ucol.h" |
27 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 // The outer map keys are ICU locale identifiers. | 883 // The outer map keys are ICU locale identifiers. |
885 // The inner maps map from localized country names to their corresponding | 884 // The inner maps map from localized country names to their corresponding |
886 // country codes. The inner map keys are ICU collation sort keys corresponding | 885 // country codes. The inner map keys are ICU collation sort keys corresponding |
887 // to the target localized country name. | 886 // to the target localized country name. |
888 std::map<std::string, std::map<std::string, std::string> > | 887 std::map<std::string, std::map<std::string, std::string> > |
889 locales_to_localized_names_; | 888 locales_to_localized_names_; |
890 | 889 |
891 // Maps ICU locale names to their corresponding collators. | 890 // Maps ICU locale names to their corresponding collators. |
892 std::map<std::string, icu::Collator*> collators_; | 891 std::map<std::string, icu::Collator*> collators_; |
893 | 892 |
894 // Verifies thread-safety of accesses to the application locale. | |
895 base::ThreadChecker thread_checker_; | |
896 | |
897 DISALLOW_COPY_AND_ASSIGN(CountryNames); | 893 DISALLOW_COPY_AND_ASSIGN(CountryNames); |
898 }; | 894 }; |
899 | 895 |
900 // static | 896 // static |
901 CountryNames* CountryNames::GetInstance() { | 897 CountryNames* CountryNames::GetInstance() { |
902 return Singleton<CountryNames>::get(); | 898 return Singleton<CountryNames>::get(); |
903 } | 899 } |
904 | 900 |
905 CountryNames::CountryNames() { | 901 CountryNames::CountryNames() { |
906 // Add 2- and 3-letter ISO country codes. | 902 // Add 2- and 3-letter ISO country codes. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 const base::string16& name, | 1102 const base::string16& name, |
1107 const base::string16& postal_code_label, | 1103 const base::string16& postal_code_label, |
1108 const base::string16& state_label) | 1104 const base::string16& state_label) |
1109 : country_code_(country_code), | 1105 : country_code_(country_code), |
1110 name_(name), | 1106 name_(name), |
1111 postal_code_label_(postal_code_label), | 1107 postal_code_label_(postal_code_label), |
1112 state_label_(state_label) { | 1108 state_label_(state_label) { |
1113 } | 1109 } |
1114 | 1110 |
1115 } // namespace autofill | 1111 } // namespace autofill |
OLD | NEW |