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 #include "chrome/common/spellcheck_common.h" | 5 #include "components/spellcheck/common/spellcheck_common.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "third_party/icu/source/common/unicode/uloc.h" | 14 #include "third_party/icu/source/common/unicode/uloc.h" |
15 #include "third_party/icu/source/common/unicode/urename.h" | 15 #include "third_party/icu/source/common/unicode/urename.h" |
16 #include "third_party/icu/source/common/unicode/utypes.h" | 16 #include "third_party/icu/source/common/unicode/utypes.h" |
17 | 17 |
18 namespace chrome { | |
19 namespace spellcheck_common { | 18 namespace spellcheck_common { |
20 | 19 |
21 struct LanguageRegion { | 20 struct LanguageRegion { |
22 const char* language; // The language. | 21 const char* language; // The language. |
23 const char* language_region; // language & region, used by dictionaries. | 22 const char* language_region; // language & region, used by dictionaries. |
24 }; | 23 }; |
25 | 24 |
26 struct LanguageVersion { | 25 struct LanguageVersion { |
27 const char* language; // The language input. | 26 const char* language; // The language input. |
28 const char* version; // The corresponding version. | 27 const char* version; // The corresponding version. |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 uloc_addLikelySubtags(locale.c_str(), id, arraysize(id), &error); | 187 uloc_addLikelySubtags(locale.c_str(), id, arraysize(id), &error); |
189 error = U_ZERO_ERROR; | 188 error = U_ZERO_ERROR; |
190 uloc_getLanguage(id, language, arraysize(language), &error); | 189 uloc_getLanguage(id, language, arraysize(language), &error); |
191 country = uloc_getISO3Country(id); | 190 country = uloc_getISO3Country(id); |
192 } | 191 } |
193 *language_code = std::string(language); | 192 *language_code = std::string(language); |
194 *country_code = std::string(country); | 193 *country_code = std::string(country); |
195 } | 194 } |
196 | 195 |
197 } // namespace spellcheck_common | 196 } // namespace spellcheck_common |
198 } // namespace chrome | 197 |
OLD | NEW |