diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 18:17:08 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 18:17:08 +0000 |
commit | 8d97adeeabe5d28a50711423268168448bf56fd5 (patch) | |
tree | 9ef3250afc5c77c3425bb8c3789d7136cc99336b /chrome/renderer/spellchecker/spellcheck.h | |
parent | 9e611f644c8043f2cf957af5ed094b1280ee1459 (diff) | |
download | chromium_src-8d97adeeabe5d28a50711423268168448bf56fd5.zip chromium_src-8d97adeeabe5d28a50711423268168448bf56fd5.tar.gz chromium_src-8d97adeeabe5d28a50711423268168448bf56fd5.tar.bz2 |
Move a bunch of Chrome specific code out of RenderThread, in preparation of moving it to content.
Review URL: http://codereview.chromium.org/6850003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/spellchecker/spellcheck.h')
-rw-r--r-- | chrome/renderer/spellchecker/spellcheck.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/chrome/renderer/spellchecker/spellcheck.h b/chrome/renderer/spellchecker/spellcheck.h index 29980b5..0af6ef8 100644 --- a/chrome/renderer/spellchecker/spellcheck.h +++ b/chrome/renderer/spellchecker/spellcheck.h @@ -9,11 +9,14 @@ #include <string> #include <vector> +#include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "base/platform_file.h" #include "base/string16.h" #include "base/time.h" #include "chrome/renderer/spellchecker/spellcheck_worditerator.h" +#include "content/renderer/render_process_observer.h" +#include "ipc/ipc_platform_file.h" #include "unicode/uscript.h" class Hunspell; @@ -24,10 +27,9 @@ class MemoryMappedFile; // TODO(morrita): Needs reorg with SpellCheckProvider. // See http://crbug.com/73699. -class SpellCheck { +class SpellCheck : public RenderProcessObserver { public: SpellCheck(); - ~SpellCheck(); void Init(base::PlatformFile file, @@ -59,14 +61,6 @@ class SpellCheck { // behind its command line flag. string16 GetAutoCorrectionWord(const string16& word, int tag); - // Turn auto spell correct support ON or OFF. - // |turn_on| = true means turn ON; false means turn OFF. - void EnableAutoSpellCorrect(bool turn_on); - - // Add a word to the custom list. This may be called before or after - // |hunspell_| has been initialized. - void WordAdded(const std::string& word); - // Returns true if the spellchecker delegate checking to a system-provided // checker on the browser process. bool is_using_platform_spelling_engine() const { @@ -74,6 +68,19 @@ class SpellCheck { } private: + FRIEND_TEST(SpellCheckTest, GetAutoCorrectionWord_EN_US); + + // RenderProcessObserver implementation: + virtual bool OnControlMessageReceived(const IPC::Message& message); + + // Message handlers. + void OnInit(IPC::PlatformFileForTransit bdict_file, + const std::vector<std::string>& custom_words, + const std::string& language, + bool auto_spell_correct); + void OnWordAdded(const std::string& word); + void OnEnableAutoSpellCorrect(bool enable); + // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is // non-null. This blocks. void InitializeHunspell(); |