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

Side by Side Diff: components/autofill/core/browser/autofill_country.cc

Issue 2231753002: components: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more call site Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/core/browser/autofill_country.h" 5 #include "components/autofill/core/browser/autofill_country.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 UErrorCode error_ignored = U_ZERO_ERROR; 49 UErrorCode error_ignored = U_ZERO_ERROR;
50 uloc_addLikelySubtags(locale.c_str(), 50 uloc_addLikelySubtags(locale.c_str(),
51 base::WriteInto(&likely_locale, kLocaleCapacity), 51 base::WriteInto(&likely_locale, kLocaleCapacity),
52 kLocaleCapacity, 52 kLocaleCapacity,
53 &error_ignored); 53 &error_ignored);
54 54
55 // Extract the country code. 55 // Extract the country code.
56 std::string country_code = icu::Locale(likely_locale.c_str()).getCountry(); 56 std::string country_code = icu::Locale(likely_locale.c_str()).getCountry();
57 57
58 // Default to the United States if we have no better guess. 58 // Default to the United States if we have no better guess.
59 if (!ContainsValue(CountryDataMap::GetInstance()->country_codes(), 59 if (!base::ContainsValue(CountryDataMap::GetInstance()->country_codes(),
60 country_code)) { 60 country_code)) {
61 return "US"; 61 return "US";
62 } 62 }
63 63
64 return country_code; 64 return country_code;
65 } 65 }
66 66
67 AutofillCountry::AutofillCountry(const std::string& country_code, 67 AutofillCountry::AutofillCountry(const std::string& country_code,
68 const base::string16& name, 68 const base::string16& name,
69 const base::string16& postal_code_label, 69 const base::string16& postal_code_label,
70 const base::string16& state_label) 70 const base::string16& state_label)
71 : country_code_(country_code), 71 : country_code_(country_code),
72 name_(name), 72 name_(name),
73 postal_code_label_(postal_code_label), 73 postal_code_label_(postal_code_label),
74 state_label_(state_label) { 74 state_label_(state_label) {
75 } 75 }
76 76
77 } // namespace autofill 77 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/form_cache.cc ('k') | components/autofill/core/browser/autofill_download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698