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 COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ | 5 #ifndef COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ |
6 #define COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ | 6 #define COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/files/file.h" | 13 #include "base/files/file.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/scoped_vector.h" |
16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
18 #include "components/spellcheck/renderer/custom_dictionary_engine.h" | 19 #include "components/spellcheck/renderer/custom_dictionary_engine.h" |
19 #include "components/spellcheck/spellcheck_build_features.h" | 20 #include "components/spellcheck/spellcheck_build_features.h" |
20 #include "content/public/renderer/render_thread_observer.h" | 21 #include "content/public/renderer/render_thread_observer.h" |
21 | 22 |
22 struct SpellCheckBDictLanguage; | 23 struct SpellCheckBDictLanguage; |
23 class SpellcheckLanguage; | 24 class SpellcheckLanguage; |
24 struct SpellCheckResult; | 25 struct SpellCheckResult; |
25 | 26 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // The parameters of a pending background-spellchecking request. When WebKit | 144 // The parameters of a pending background-spellchecking request. When WebKit |
144 // sends a background-spellchecking request before initializing hunspell, | 145 // sends a background-spellchecking request before initializing hunspell, |
145 // we save its parameters and start spellchecking after we finish initializing | 146 // we save its parameters and start spellchecking after we finish initializing |
146 // hunspell. (When WebKit sends two or more requests, we cancel the previous | 147 // hunspell. (When WebKit sends two or more requests, we cancel the previous |
147 // requests so we do not have to use vectors.) | 148 // requests so we do not have to use vectors.) |
148 std::unique_ptr<SpellcheckRequest> pending_request_param_; | 149 std::unique_ptr<SpellcheckRequest> pending_request_param_; |
149 #endif | 150 #endif |
150 | 151 |
151 // A vector of objects used to actually check spelling, one for each enabled | 152 // A vector of objects used to actually check spelling, one for each enabled |
152 // language. | 153 // language. |
153 std::vector<std::unique_ptr<SpellcheckLanguage>> languages_; | 154 ScopedVector<SpellcheckLanguage> languages_; |
154 | 155 |
155 // Custom dictionary spelling engine. | 156 // Custom dictionary spelling engine. |
156 CustomDictionaryEngine custom_dictionary_; | 157 CustomDictionaryEngine custom_dictionary_; |
157 | 158 |
158 // Remember state for spellchecking. | 159 // Remember state for spellchecking. |
159 bool spellcheck_enabled_; | 160 bool spellcheck_enabled_; |
160 | 161 |
161 DISALLOW_COPY_AND_ASSIGN(SpellCheck); | 162 DISALLOW_COPY_AND_ASSIGN(SpellCheck); |
162 }; | 163 }; |
163 | 164 |
164 #endif // COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ | 165 #endif // COMPONENTS_SPELLCHECK_RENDERER_SPELLCHECK_H_ |
OLD | NEW |