diff options
author | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 21:08:11 +0000 |
---|---|---|
committer | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 21:08:11 +0000 |
commit | c5f9f1854f1cac2a4e7c459e86bc46a44365f7cf (patch) | |
tree | cdcd7a41d9fe730b0f704d153bdbf47b51a7c09c /chrome/browser/views | |
parent | 8bbe7efe110336916c819fdc7f5566afa3a97495 (diff) | |
download | chromium_src-c5f9f1854f1cac2a4e7c459e86bc46a44365f7cf.zip chromium_src-c5f9f1854f1cac2a4e7c459e86bc46a44365f7cf.tar.gz chromium_src-c5f9f1854f1cac2a4e7c459e86bc46a44365f7cf.tar.bz2 |
Add a new submenu in the context menu for a text box. This submenu displays some spell check languages that Chrome supports, derived from the accept languages list and the current spell check language. The spell check language which is currently set is shown to be selected. The user can click on some other spell check language, and it will become effective immediately (this part of the code was addressed in a previous CL, and has been checked in).
Review URL: http://codereview.chromium.org/12614
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6162 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/options/languages_page_view.cc | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 78d5235..118ac10 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -16,6 +16,7 @@ #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/shell_dialogs.h" +#include "chrome/browser/spellchecker.h" #include "chrome/browser/views/options/language_combobox_model.h" #include "chrome/browser/views/password_manager_view.h" #include "chrome/browser/views/restart_message_box.h" @@ -40,43 +41,6 @@ #include "chromium_strings.h" #include "generated_resources.h" -static const wchar_t* const g_supported_spellchecker_languages[] = { - L"en-US", - L"en-GB", - L"fr-FR", - L"it-IT", - L"de-DE", - L"es-ES", - L"nl-NL", - L"pt-BR", - L"ru-RU", - L"pl-PL", - // L"th-TH", // Not to be included in Spellchecker as per B=1277824 - L"sv-SE", - L"da-DK", - L"pt-PT", - L"ro-RO", - // L"hu-HU", // Not to be included in Spellchecker as per B=1277824 - // L"he-IL", // Not to be included in Spellchecker as per B=1252241 - L"id-ID", - L"cs-CZ", - L"el-GR", - L"nb-NO", - L"vi-VN", - // L"bg-BG", // Not to be included in Spellchecker as per B=1277824 - L"hr-HR", - L"lt-LT", - L"sk-SK", - L"sl-SI", - L"ca-ES", - L"lv-LV", - // L"uk-UA", // Not to be included in Spellchecker as per B=1277824 - L"hi-IN", - // - // TODO(Sidchat): Uncomment/remove languages as and when they get resolved. - // -}; - static const wchar_t* const accept_language_list[] = { L"af", // Afrikaans L"am", // Amharic @@ -665,8 +629,13 @@ void LanguagesPageView::InitControlLayout() { // Determine Locale Codes. std::vector<std::wstring> locale_codes; - for (size_t i = 0; i < arraysize(g_supported_spellchecker_languages); ++i) - locale_codes.push_back(g_supported_spellchecker_languages[i]); + std::vector<std::wstring> spell_check_languages; + SpellChecker::SpellCheckLanguages(&spell_check_languages); + for (size_t i = 0; + i < spell_check_languages.size(); + ++i) { + locale_codes.push_back(spell_check_languages.at(i)); + } dictionary_language_model_.reset(new LanguageComboboxModel(profile(), locale_codes)); change_dictionary_language_combobox_ = |