| 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_HUNSPELL_ENGINE_H_ | 5 #ifndef CHROME_RENDERER_SPELLCHECKER_HUNSPELL_ENGINE_H_ |
| 6 #define CHROME_RENDERER_SPELLCHECKER_HUNSPELL_ENGINE_H_ | 6 #define CHROME_RENDERER_SPELLCHECKER_HUNSPELL_ENGINE_H_ |
| 7 | 7 |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/renderer/spellchecker/spelling_engine.h" | 12 #include "chrome/renderer/spellchecker/spelling_engine.h" |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 class Hunspell; | 17 class Hunspell; |
| 18 | 18 |
| 19 class HunspellEngine : public SpellingEngine { | 19 class HunspellEngine : public SpellingEngine { |
| 20 public: | 20 public: |
| 21 HunspellEngine(); | 21 HunspellEngine(); |
| 22 virtual ~HunspellEngine(); | 22 virtual ~HunspellEngine(); |
| 23 | 23 |
| 24 void Init(base::PlatformFile file, | 24 virtual void Init(base::PlatformFile file, |
| 25 const std::vector<std::string>& custom_words); | 25 const std::vector<std::string>& custom_words) OVERRIDE; |
| 26 | 26 |
| 27 virtual bool InitializeIfNeeded() OVERRIDE; | 27 virtual bool InitializeIfNeeded() OVERRIDE; |
| 28 virtual bool IsEnabled() OVERRIDE; | 28 virtual bool IsEnabled() OVERRIDE; |
| 29 virtual bool CheckSpelling(const string16& word_to_check, int tag) OVERRIDE; | 29 virtual bool CheckSpelling(const string16& word_to_check, int tag) OVERRIDE; |
| 30 virtual void FillSuggestionList(const string16& wrong_word, | 30 virtual void FillSuggestionList(const string16& wrong_word, |
| 31 std::vector<string16>* optional_suggestions) OVERRIDE; | 31 std::vector<string16>* optional_suggestions) OVERRIDE; |
| 32 virtual void OnWordAdded(const std::string& word) OVERRIDE; | 32 virtual void OnWordAdded(const std::string& word) OVERRIDE; |
| 33 private: | 33 private: |
| 34 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is | 34 // Initializes the Hunspell dictionary, or does nothing if |hunspell_| is |
| 35 // non-null. This blocks. | 35 // non-null. This blocks. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 54 // spelling of a word. | 54 // spelling of a word. |
| 55 bool initialized_; | 55 bool initialized_; |
| 56 | 56 |
| 57 // This flags is true if we have requested dictionary. | 57 // This flags is true if we have requested dictionary. |
| 58 bool dictionary_requested_; | 58 bool dictionary_requested_; |
| 59 | 59 |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif // CHROME_RENDERER_SPELLCHECKER_HUNSPELL_ENGINE_H_ | 62 #endif // CHROME_RENDERER_SPELLCHECKER_HUNSPELL_ENGINE_H_ |
| 63 | 63 |
| OLD | NEW |