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

Side by Side Diff: ui/base/l10n/l10n_util.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « tools/gn/ninja_target_writer.cc ('k') | ui/gfx/font_list.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 (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 "ui/base/l10n/l10n_util.h" 5 #include "ui/base/l10n/l10n_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdlib> 8 #include <cstdlib>
9 #include <iterator> 9 #include <iterator>
10 #include <string> 10 #include <string>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 "pt", // pt-BR and pt-PT are used. 194 "pt", // pt-BR and pt-PT are used.
195 "zh", 195 "zh",
196 "zh_hans_cn", 196 "zh_hans_cn",
197 "zh_hant_hk", 197 "zh_hant_hk",
198 "zh_hant_mo", 198 "zh_hant_mo",
199 "zh_hans_sg", 199 "zh_hans_sg",
200 "zh_hant_tw" 200 "zh_hant_tw"
201 }; 201 };
202 202
203 // Skip all the es_Foo other than es_419 for now. 203 // Skip all the es_Foo other than es_419 for now.
204 if (base::StartsWithASCII(locale_name, "es_", false)) 204 if (base::StartsWith(locale_name, "es_",
205 return !base::EndsWith(locale_name, "419", true); 205 base::CompareCase::INSENSITIVE_ASCII))
206 return !base::EndsWith(locale_name, "419", base::CompareCase::SENSITIVE);
206 207
207 for (size_t i = 0; i < arraysize(kDuplicateNames); ++i) { 208 for (size_t i = 0; i < arraysize(kDuplicateNames); ++i) {
208 if (base::EqualsCaseInsensitiveASCII(kDuplicateNames[i], locale_name)) 209 if (base::EqualsCaseInsensitiveASCII(kDuplicateNames[i], locale_name))
209 return true; 210 return true;
210 } 211 }
211 return false; 212 return false;
212 } 213 }
213 214
214 // We added 30+ minimally populated locales with only a few entries 215 // We added 30+ minimally populated locales with only a few entries
215 // (exemplar character set, script, writing direction and its own 216 // (exemplar character set, script, writing direction and its own
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 874
874 const char* const* GetAcceptLanguageListForTesting() { 875 const char* const* GetAcceptLanguageListForTesting() {
875 return kAcceptLanguageList; 876 return kAcceptLanguageList;
876 } 877 }
877 878
878 size_t GetAcceptLanguageListSizeForTesting() { 879 size_t GetAcceptLanguageListSizeForTesting() {
879 return arraysize(kAcceptLanguageList); 880 return arraysize(kAcceptLanguageList);
880 } 881 }
881 882
882 } // namespace l10n_util 883 } // namespace l10n_util
OLDNEW
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | ui/gfx/font_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698