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

Side by Side Diff: components/autofill/core/browser/country_names.h

Issue 1859453002: components/autofill: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 #include <string> 10 #include <string>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "third_party/icu/source/common/unicode/locid.h" 15 #include "third_party/icu/source/common/unicode/locid.h"
16 #include "third_party/icu/source/i18n/unicode/coll.h" 16 #include "third_party/icu/source/i18n/unicode/coll.h"
17 17
18 namespace base { 18 namespace base {
19 template <typename T> 19 template <typename T>
20 struct DefaultSingletonTraits; 20 struct DefaultSingletonTraits;
21 } 21 }
22 22
23 namespace autofill { 23 namespace autofill {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const icu::Collator& collator); 61 const icu::Collator& collator);
62 62
63 // Returns an ICU collator -- i.e. string comparator -- appropriate for the 63 // Returns an ICU collator -- i.e. string comparator -- appropriate for the
64 // given |locale|, or null if no collator is available. 64 // given |locale|, or null if no collator is available.
65 const icu::Collator* GetCollatorForLocale(const icu::Locale& locale); 65 const icu::Collator* GetCollatorForLocale(const icu::Locale& locale);
66 66
67 // The locale object for the application locale string. 67 // The locale object for the application locale string.
68 const icu::Locale locale_; 68 const icu::Locale locale_;
69 69
70 // Collator for the application locale. 70 // Collator for the application locale.
71 const scoped_ptr<icu::Collator> collator_; 71 const std::unique_ptr<icu::Collator> collator_;
72 72
73 // Collator for the "en_US" locale, if different from the application 73 // Collator for the "en_US" locale, if different from the application
74 // locale, null otherwise. 74 // locale, null otherwise.
75 const scoped_ptr<icu::Collator> default_collator_; 75 const std::unique_ptr<icu::Collator> default_collator_;
76 76
77 // Maps from common country names, including 2- and 3-letter country codes, 77 // Maps from common country names, including 2- and 3-letter country codes,
78 // to the corresponding 2-letter country codes. The keys are uppercase ASCII 78 // to the corresponding 2-letter country codes. The keys are uppercase ASCII
79 // strings. 79 // strings.
80 const std::map<std::string, std::string> common_names_; 80 const std::map<std::string, std::string> common_names_;
81 81
82 // Maps from localized country names (in the application locale) to their 82 // Maps from localized country names (in the application locale) to their
83 // corresponding country codes. The keys are ICU collation sort keys 83 // corresponding country codes. The keys are ICU collation sort keys
84 // corresponding to the target localized country name. 84 // corresponding to the target localized country name.
85 const std::map<std::string, std::string> localized_names_; 85 const std::map<std::string, std::string> localized_names_;
86 86
87 // The same as |localized_names_| but for the "en_US" locale. Empty if 87 // The same as |localized_names_| but for the "en_US" locale. Empty if
88 // "en_US" is the application locale already. 88 // "en_US" is the application locale already.
89 const std::map<std::string, std::string> default_localized_names_; 89 const std::map<std::string, std::string> default_localized_names_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(CountryNames); 91 DISALLOW_COPY_AND_ASSIGN(CountryNames);
92 }; 92 };
93 93
94 } // namespace autofill 94 } // namespace autofill
95 95
96 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_ 96 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_COUNTRY_NAMES_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_xml_parser_unittest.cc ('k') | components/autofill/core/browser/country_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698