OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 | 8 |
9 #include "app/app_paths.h" | 9 #include "app/app_paths.h" |
10 #include "app/app_switches.h" | 10 #include "app/app_switches.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const FilePath& locale_path) { | 122 const FilePath& locale_path) { |
123 // If locale has any illegal characters in it, we don't want to try to | 123 // If locale has any illegal characters in it, we don't want to try to |
124 // load it because it may be pointing outside the locale data file directory. | 124 // load it because it may be pointing outside the locale data file directory. |
125 if (!file_util::IsFilenameLegal(ASCIIToUTF16(locale))) | 125 if (!file_util::IsFilenameLegal(ASCIIToUTF16(locale))) |
126 return false; | 126 return false; |
127 | 127 |
128 if (!l10n_util::IsLocaleSupportedByOS(locale)) | 128 if (!l10n_util::IsLocaleSupportedByOS(locale)) |
129 return false; | 129 return false; |
130 | 130 |
131 FilePath test_path = locale_path; | 131 FilePath test_path = locale_path; |
132 test_path.AppendASCII(locale).ReplaceExtension(kLocaleFileExtension); | 132 test_path = |
| 133 test_path.AppendASCII(locale).ReplaceExtension(kLocaleFileExtension); |
133 return file_util::PathExists(test_path) && SetICUDefaultLocale(locale); | 134 return file_util::PathExists(test_path) && SetICUDefaultLocale(locale); |
134 } | 135 } |
135 | 136 |
136 bool CheckAndResolveLocale(const std::string& locale, | 137 bool CheckAndResolveLocale(const std::string& locale, |
137 const FilePath& locale_path, | 138 const FilePath& locale_path, |
138 std::string* resolved_locale) { | 139 std::string* resolved_locale) { |
139 if (IsLocaleAvailable(locale, locale_path)) { | 140 if (IsLocaleAvailable(locale, locale_path)) { |
140 *resolved_locale = locale; | 141 *resolved_locale = locale; |
141 return true; | 142 return true; |
142 } | 143 } |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } | 772 } |
772 | 773 |
773 void BiDiLineIterator::GetLogicalRun(int start, | 774 void BiDiLineIterator::GetLogicalRun(int start, |
774 int* end, | 775 int* end, |
775 UBiDiLevel* level) { | 776 UBiDiLevel* level) { |
776 DCHECK(bidi_ != NULL); | 777 DCHECK(bidi_ != NULL); |
777 ubidi_getLogicalRun(bidi_, start, end, level); | 778 ubidi_getLogicalRun(bidi_, start, end, level); |
778 } | 779 } |
779 | 780 |
780 } | 781 } |
OLD | NEW |