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

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

Issue 5756007: Revert 69165 - Merge the installer, installer_util and setup_util namespaces ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 candidates->push_back(language); 204 candidates->push_back(language);
205 } 205 }
206 206
207 // Now try the Windows UI languages. Use the thread preferred since that will 207 // Now try the Windows UI languages. Use the thread preferred since that will
208 // kindly return us a list of all kinds of fallbacks. 208 // kindly return us a list of all kinds of fallbacks.
209 base::win::i18n::GetThreadPreferredUILanguageList(candidates); 209 base::win::i18n::GetThreadPreferredUILanguageList(candidates);
210 } 210 }
211 211
212 } // namespace 212 } // namespace
213 213
214 namespace installer { 214 namespace installer_util {
215 215
216 LanguageSelector::LanguageSelector() 216 LanguageSelector::LanguageSelector()
217 : offset_(arraysize(kLanguageOffsetPairs)) { 217 : offset_(arraysize(kLanguageOffsetPairs)) {
218 #if !defined(NDEBUG) 218 #if !defined(NDEBUG)
219 ValidateMappings(); 219 ValidateMappings();
220 #endif // !defined(NDEBUG) 220 #endif // !defined(NDEBUG)
221 std::vector<std::wstring> candidates; 221 std::vector<std::wstring> candidates;
222 222
223 GetCandidatesFromSystem(&candidates); 223 GetCandidatesFromSystem(&candidates);
224 DoSelect(candidates); 224 DoSelect(candidates);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 &offset_)) { 291 &offset_)) {
292 VLOG(1) << "No suitable language found for any candidates."; 292 VLOG(1) << "No suitable language found for any candidates.";
293 293
294 // Our fallback is "en-us" 294 // Our fallback is "en-us"
295 matched_candidate_.assign(&kFallbackLanguage[0], 295 matched_candidate_.assign(&kFallbackLanguage[0],
296 arraysize(kFallbackLanguage) - 1); 296 arraysize(kFallbackLanguage) - 1);
297 offset_ = kFallbackLanguageOffset; 297 offset_ = kFallbackLanguageOffset;
298 } 298 }
299 } 299 }
300 300
301 } // namespace installer 301 } // namespace installer_util
OLDNEW
« no previous file with comments | « chrome/installer/util/language_selector.h ('k') | chrome/installer/util/language_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698