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 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ | 5 #ifndef CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ |
6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ | 6 #define CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Find a possible correctly spelled word for a misspelled word. Computes an | 87 // Find a possible correctly spelled word for a misspelled word. Computes an |
88 // empty string if input misspelled word is too long, there is ambiguity, or | 88 // empty string if input misspelled word is too long, there is ambiguity, or |
89 // the correct spelling cannot be determined. | 89 // the correct spelling cannot be determined. |
90 // NOTE: If using the platform spellchecker, this will send a *lot* of sync | 90 // NOTE: If using the platform spellchecker, this will send a *lot* of sync |
91 // IPCs. We should probably refactor this if we ever plan to take it out from | 91 // IPCs. We should probably refactor this if we ever plan to take it out from |
92 // behind its command line flag. | 92 // behind its command line flag. |
93 base::string16 GetAutoCorrectionWord(const base::string16& word, int tag); | 93 base::string16 GetAutoCorrectionWord(const base::string16& word, int tag); |
94 | 94 |
95 // Requests to spellcheck the specified text in the background. This function | 95 // Requests to spellcheck the specified text in the background. This function |
96 // posts a background task and calls SpellCheckParagraph() in the task. | 96 // posts a background task and calls SpellCheckParagraph() in the task. |
97 #if !defined (OS_MACOSX) | 97 #if !defined (USE_BROWSER_SPELLCHECKER) |
98 void RequestTextChecking(const base::string16& text, | 98 void RequestTextChecking(const base::string16& text, |
99 blink::WebTextCheckingCompletion* completion); | 99 blink::WebTextCheckingCompletion* completion); |
100 #endif | 100 #endif |
101 | 101 |
102 // Creates a list of WebTextCheckingResult objects (used by WebKit) from a | 102 // Creates a list of WebTextCheckingResult objects (used by WebKit) from a |
103 // list of SpellCheckResult objects (used by Chrome). This function also | 103 // list of SpellCheckResult objects (used by Chrome). This function also |
104 // checks misspelled words returned by the Spelling service and changes the | 104 // checks misspelled words returned by the Spelling service and changes the |
105 // underline colors of contextually-misspelled words. | 105 // underline colors of contextually-misspelled words. |
106 void CreateTextCheckingResults( | 106 void CreateTextCheckingResults( |
107 ResultFilter filter, | 107 ResultFilter filter, |
(...skipping 16 matching lines...) Expand all Loading... |
124 // Message handlers. | 124 // Message handlers. |
125 void OnInit(const std::vector<SpellCheckBDictLanguage>& bdict_languages, | 125 void OnInit(const std::vector<SpellCheckBDictLanguage>& bdict_languages, |
126 const std::set<std::string>& custom_words, | 126 const std::set<std::string>& custom_words, |
127 bool auto_spell_correct); | 127 bool auto_spell_correct); |
128 void OnCustomDictionaryChanged(const std::set<std::string>& words_added, | 128 void OnCustomDictionaryChanged(const std::set<std::string>& words_added, |
129 const std::set<std::string>& words_removed); | 129 const std::set<std::string>& words_removed); |
130 void OnEnableAutoSpellCorrect(bool enable); | 130 void OnEnableAutoSpellCorrect(bool enable); |
131 void OnEnableSpellCheck(bool enable); | 131 void OnEnableSpellCheck(bool enable); |
132 void OnRequestDocumentMarkers(); | 132 void OnRequestDocumentMarkers(); |
133 | 133 |
134 #if !defined (OS_MACOSX) | 134 #if !defined (USE_BROWSER_SPELLCHECKER) |
135 // Posts delayed spellcheck task and clear it if any. | 135 // Posts delayed spellcheck task and clear it if any. |
136 // Takes ownership of |request|. | 136 // Takes ownership of |request|. |
137 void PostDelayedSpellCheckTask(SpellcheckRequest* request); | 137 void PostDelayedSpellCheckTask(SpellcheckRequest* request); |
138 | 138 |
139 // Performs spell checking from the request queue. | 139 // Performs spell checking from the request queue. |
140 void PerformSpellCheck(SpellcheckRequest* request); | 140 void PerformSpellCheck(SpellcheckRequest* request); |
141 | 141 |
142 // The parameters of a pending background-spellchecking request. When WebKit | 142 // The parameters of a pending background-spellchecking request. When WebKit |
143 // sends a background-spellchecking request before initializing hunspell, | 143 // sends a background-spellchecking request before initializing hunspell, |
144 // we save its parameters and start spellchecking after we finish initializing | 144 // we save its parameters and start spellchecking after we finish initializing |
(...skipping 12 matching lines...) Expand all Loading... |
157 // Remember state for auto spell correct. | 157 // Remember state for auto spell correct. |
158 bool auto_spell_correct_turned_on_; | 158 bool auto_spell_correct_turned_on_; |
159 | 159 |
160 // Remember state for spellchecking. | 160 // Remember state for spellchecking. |
161 bool spellcheck_enabled_; | 161 bool spellcheck_enabled_; |
162 | 162 |
163 DISALLOW_COPY_AND_ASSIGN(SpellCheck); | 163 DISALLOW_COPY_AND_ASSIGN(SpellCheck); |
164 }; | 164 }; |
165 | 165 |
166 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ | 166 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ |
OLD | NEW |