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

Side by Side Diff: chrome/installer/util/language_selector.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 // This file defines a helper class for selecting a supported language from a 5 // This file defines a helper class for selecting a supported language from a
6 // set of candidates. 6 // set of candidates.
7 7
8 #include "chrome/installer/util/language_selector.h" 8 #include "chrome/installer/util/language_selector.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // selected translation. 255 // selected translation.
256 // static 256 // static
257 bool LanguageSelector::SelectIf(const std::vector<std::wstring>& candidates, 257 bool LanguageSelector::SelectIf(const std::vector<std::wstring>& candidates,
258 SelectPred_Fn select_predicate, 258 SelectPred_Fn select_predicate,
259 std::wstring* matched_name, 259 std::wstring* matched_name,
260 int* matched_offset) { 260 int* matched_offset) {
261 std::wstring candidate; 261 std::wstring candidate;
262 for (std::vector<std::wstring>::const_iterator scan = candidates.begin(), 262 for (std::vector<std::wstring>::const_iterator scan = candidates.begin(),
263 end = candidates.end(); scan != end; ++scan) { 263 end = candidates.end(); scan != end; ++scan) {
264 candidate.assign(*scan); 264 candidate.assign(*scan);
265 StringToLowerASCII(&candidate); 265 base::StringToLowerASCII(&candidate);
266 if (select_predicate(candidate, matched_offset)) { 266 if (select_predicate(candidate, matched_offset)) {
267 matched_name->assign(*scan); 267 matched_name->assign(*scan);
268 return true; 268 return true;
269 } 269 }
270 } 270 }
271 271
272 return false; 272 return false;
273 } 273 }
274 274
275 // Select the best-fit translation from the ordered list |candidates|. 275 // Select the best-fit translation from the ordered list |candidates|.
(...skipping 11 matching lines...) Expand all
287 VLOG(1) << "No suitable language found for any candidates."; 287 VLOG(1) << "No suitable language found for any candidates.";
288 288
289 // Our fallback is "en-us" 289 // Our fallback is "en-us"
290 matched_candidate_.assign(&kFallbackLanguage[0], 290 matched_candidate_.assign(&kFallbackLanguage[0],
291 arraysize(kFallbackLanguage) - 1); 291 arraysize(kFallbackLanguage) - 1);
292 offset_ = kFallbackLanguageOffset; 292 offset_ = kFallbackLanguageOffset;
293 } 293 }
294 } 294 }
295 295
296 } // namespace installer 296 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/common/importer/firefox_importer_utils.cc ('k') | chrome/renderer/pepper/pepper_flash_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698