| 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 // Returns true if the spellchecker delegate checking to a system-provided |
| 69 // checker on the browser process. |
| 70 bool is_using_platform_spelling_engine() const { |
| 71 return is_using_platform_spelling_engine_; |
| 72 } |
| 73 |
| 68 private: | 74 private: |
| 69 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is | 75 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is |
| 70 // non-null. This blocks. | 76 // non-null. This blocks. |
| 71 void InitializeHunspell(); | 77 void InitializeHunspell(); |
| 72 | 78 |
| 73 // If there is no dictionary file, then this requests one from the browser | 79 // If there is no dictionary file, then this requests one from the browser |
| 74 // and does not block. In this case it returns true. | 80 // and does not block. In this case it returns true. |
| 75 // If there is a dictionary file, but Hunspell has not been loaded, then | 81 // If there is a dictionary file, but Hunspell has not been loaded, then |
| 76 // this loads Hunspell. | 82 // this loads Hunspell. |
| 77 // If Hunspell is already loaded, this does nothing. In both the latter cases | 83 // 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 | 123 // 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 | 124 // 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 | 125 // dictionary from the browser when the render view asks us to check the |
| 120 // spelling of a word. | 126 // spelling of a word. |
| 121 bool initialized_; | 127 bool initialized_; |
| 122 | 128 |
| 123 DISALLOW_COPY_AND_ASSIGN(SpellCheck); | 129 DISALLOW_COPY_AND_ASSIGN(SpellCheck); |
| 124 }; | 130 }; |
| 125 | 131 |
| 126 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ | 132 #endif // CHROME_RENDERER_SPELLCHECKER_SPELLCHECK_H_ |
| OLD | NEW |