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

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

Issue 1635813003: country_names.cc: change SetLocaleString to take const ref instead of value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | components/autofill/core/browser/country_names.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 // corresponding country codes. 26 // corresponding country codes.
27 class CountryNames { 27 class CountryNames {
28 public: 28 public:
29 // The first call to this function, causing the creation of CountryNames, 29 // The first call to this function, causing the creation of CountryNames,
30 // is expensive. 30 // is expensive.
31 static CountryNames* GetInstance(); 31 static CountryNames* GetInstance();
32 32
33 // Tells CountryNames, what is the application locale. Only the first supplied 33 // Tells CountryNames, what is the application locale. Only the first supplied
34 // value is used, further calls result in no changes. Call this on the UI 34 // value is used, further calls result in no changes. Call this on the UI
35 // thread, before first using CountryNames. |locale| must not be empty. 35 // thread, before first using CountryNames. |locale| must not be empty.
36 static void SetLocaleString(std::string locale); 36 static void SetLocaleString(const std::string& locale);
37 37
38 // Returns the country code corresponding to |country|, which should be a 38 // Returns the country code corresponding to |country|, which should be a
39 // country code or country name localized to |locale_name|. 39 // country code or country name localized to |locale_name|.
40 const std::string GetCountryCode(const base::string16& country); 40 const std::string GetCountryCode(const base::string16& country);
41 41
42 protected: 42 protected:
43 // Create CountryNames for |locale_name|. Protected for testing. 43 // Create CountryNames for |locale_name|. Protected for testing.
44 explicit CountryNames(const std::string& locale_name); 44 explicit CountryNames(const std::string& locale_name);
45 45
46 // Protected for testing. 46 // Protected for testing.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « no previous file | components/autofill/core/browser/country_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698