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/spellchecker.h | |
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/spellchecker.h')
-rw-r--r-- | chrome/browser/spellchecker.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/chrome/browser/spellchecker.h b/chrome/browser/spellchecker.h index bfe3121..07be6120 100644 --- a/chrome/browser/spellchecker.h +++ b/chrome/browser/spellchecker.h @@ -7,7 +7,13 @@ #include <vector> +#include "base/string_util.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/profile.h" #include "chrome/browser/spellcheck_worditerator.h" +#include "chrome/common/l10n_util.h" +#include "chrome/common/pref_names.h" +#include "chrome/common/pref_member.h" #include "base/task.h" #include "unicode/uscript.h" @@ -18,6 +24,7 @@ class Profile; class MessageLoop; class URLRequestContext; + // The Browser's Spell Checker. It checks and suggests corrections. // // This object is not threadsafe. In normal usage (not unit tests) it lives on @@ -65,7 +72,15 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { // b) Add the word to a file in disk for custom dictionary. void AddWord(const std::wstring& word); - private: + // Get SpellChecker supported languages. + static void SpellCheckLanguages(std::vector<std::wstring>* languages); + + // This function computes a vector of strings which are to be displayed in + // the context menu over a text area for changing spell check languages. It + // returns the index of the current spell check language in the vector. + static int SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu( + Profile* profile, std::vector<std::wstring>* display_language_list); + // Download dictionary files when required. class DictionaryDownloadController; @@ -93,6 +108,9 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { std::wstring GetVersionedFileName(const std::wstring& language, const std::wstring& dict_dir); + static std::wstring GetCorrespondingSpellCheckLanguage( + const std::wstring& language); + // Path to the spellchecker file. std::wstring bdict_file_name_; |