OLD | NEW |
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> |
11 #include <functional> | 11 #include <functional> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/win/i18n.h" | 16 #include "base/win/i18n.h" |
17 #include "chrome/installer/util/google_update_settings.h" | 17 #include "chrome/installer/util/google_update_settings.h" |
18 | 18 #include "chrome/installer/util/installer_util_strings.h" |
19 #include "installer_util_strings.h" | |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
23 struct LangToOffset { | 22 struct LangToOffset { |
24 const wchar_t* language; | 23 const wchar_t* language; |
25 int offset; | 24 int offset; |
26 }; | 25 }; |
27 | 26 |
28 // The language we fall back upon when all else fails. | 27 // The language we fall back upon when all else fails. |
29 const wchar_t kFallbackLanguage[] = L"en-us"; | 28 const wchar_t kFallbackLanguage[] = L"en-us"; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 VLOG(1) << "No suitable language found for any candidates."; | 286 VLOG(1) << "No suitable language found for any candidates."; |
288 | 287 |
289 // Our fallback is "en-us" | 288 // Our fallback is "en-us" |
290 matched_candidate_.assign(&kFallbackLanguage[0], | 289 matched_candidate_.assign(&kFallbackLanguage[0], |
291 arraysize(kFallbackLanguage) - 1); | 290 arraysize(kFallbackLanguage) - 1); |
292 offset_ = kFallbackLanguageOffset; | 291 offset_ = kFallbackLanguageOffset; |
293 } | 292 } |
294 } | 293 } |
295 | 294 |
296 } // namespace installer | 295 } // namespace installer |
OLD | NEW |