Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 string16 GetAutoCorrectionWord(const string16& word, int tag); | 58 string16 GetAutoCorrectionWord(const string16& word, int tag); |
| 59 | 59 |
| 60 // Turn auto spell correct support ON or OFF. | 60 // Turn auto spell correct support ON or OFF. |
| 61 // |turn_on| = true means turn ON; false means turn OFF. | 61 // |turn_on| = true means turn ON; false means turn OFF. |
| 62 void EnableAutoSpellCorrect(bool turn_on); | 62 void EnableAutoSpellCorrect(bool turn_on); |
| 63 | 63 |
| 64 // Add a word to the custom list. This may be called before or after | 64 // Add a word to the custom list. This may be called before or after |
| 65 // |hunspell_| has been initialized. | 65 // |hunspell_| has been initialized. |
| 66 void WordAdded(const std::string& word); | 66 void WordAdded(const std::string& word); |
| 67 | 67 |
| 68 // Request asynchronous spell and grammar checking. The result | |
| 69 // should be returned as a ViewMsg_SpellChecker_RespondTextCheck IPC | |
| 70 // call. | |
| 71 bool RequestCheckingOfText(int32 routing_id, | |
| 72 const string16& word, | |
|
Hironori Bono
2011/02/10 11:02:56
nit: 'word' -> 'text'? (I assume this string consi
gmorrita
2011/02/17 11:39:44
Done.
| |
| 73 int tag, | |
| 74 int request_id); | |
| 75 | |
| 68 private: | 76 private: |
| 69 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is | 77 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is |
| 70 // non-null. This blocks. | 78 // non-null. This blocks. |
| 71 void InitializeHunspell(); | 79 void InitializeHunspell(); |
| 72 | 80 |
| 73 // If there is no dictionary file, then this requests one from the browser | 81 // If there is no dictionary file, then this requests one from the browser |
| 74 // and does not block. In this case it returns true. | 82 // and does not block. In this case it returns true. |
| 75 // If there is a dictionary file, but Hunspell has not been loaded, then | 83 // If there is a dictionary file, but Hunspell has not been loaded, then |
| 76 // this loads Hunspell. | 84 // this loads Hunspell. |
| 77 // If Hunspell is already loaded, this does nothing. In both the latter cases | 85 // If Hunspell is already loaded, this does nothing. In both the latter cases |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 // This flags whether we have ever been initialized, or have asked the browser | 125 // This flags whether we have ever been initialized, or have asked the browser |
| 118 // for a dictionary. The value indicates whether we should request a | 126 // for a dictionary. The value indicates whether we should request a |
| 119 // dictionary from the browser when the render view asks us to check the | 127 // dictionary from the browser when the render view asks us to check the |
| 120 // spelling of a word. | 128 // spelling of a word. |
| 121 bool initialized_; | 129 bool initialized_; |
| 122 | 130 |
| 123 DISALLOW_COPY_AND_ASSIGN(SpellCheck); | 131 DISALLOW_COPY_AND_ASSIGN(SpellCheck); |
| 124 }; | 132 }; |
| 125 | 133 |
| 126 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ | 134 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ |
| OLD | NEW |