summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker.cc
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 22:56:56 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 22:56:56 +0000
commitf6a9e5f191be83a7d0a867eed5e5754d378101bb (patch)
treeb177aa533acf9b1a7c34fbbb8752ec8c909bb87c /chrome/browser/spellchecker.cc
parentc88620903fab9c32cb64b271b97b1fcd01bf820d (diff)
downloadchromium_src-f6a9e5f191be83a7d0a867eed5e5754d378101bb.zip
chromium_src-f6a9e5f191be83a7d0a867eed5e5754d378101bb.tar.gz
chromium_src-f6a9e5f191be83a7d0a867eed5e5754d378101bb.tar.bz2
Remember change in Spell Check language by putting it in the list of accept languages when the user changes the language from languages options menu.
It also includes a fix (required for this change to work) when existing users are updated to use language only code for spellcheck languages instead of languages+region. Issue=5829 Review URL: http://codereview.chromium.org/19520 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker.cc')
-rw-r--r--chrome/browser/spellchecker.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc
index 5cd32a6..62cff23 100644
--- a/chrome/browser/spellchecker.cc
+++ b/chrome/browser/spellchecker.cc
@@ -96,6 +96,19 @@ SpellChecker::Language SpellChecker::GetSpellCheckLanguageRegion(
return input_language;
}
+
+SpellChecker::Language SpellChecker::GetLanguageFromLanguageRegion(
+ Language input_language) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(g_supported_spellchecker_languages);
+ ++i) {
+ Language language(g_supported_spellchecker_languages[i].language_region);
+ if (language == input_language)
+ return Language(g_supported_spellchecker_languages[i].language);
+ }
+
+ return input_language;
+}
+
SpellChecker::Language SpellChecker::GetCorrespondingSpellCheckLanguage(
const Language& language) {
// Look for exact match in the Spell Check language list.