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 #include "components/spellcheck/renderer/spellcheck.h" | 5 #include "components/spellcheck/renderer/spellcheck.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const std::set<std::string>& words_added, | 215 const std::set<std::string>& words_added, |
216 const std::set<std::string>& words_removed) { | 216 const std::set<std::string>& words_removed) { |
217 custom_dictionary_.OnCustomDictionaryChanged(words_added, words_removed); | 217 custom_dictionary_.OnCustomDictionaryChanged(words_added, words_removed); |
218 if (words_added.empty()) | 218 if (words_added.empty()) |
219 return; | 219 return; |
220 DocumentMarkersRemover markersRemover(words_added); | 220 DocumentMarkersRemover markersRemover(words_added); |
221 content::RenderView::ForEach(&markersRemover); | 221 content::RenderView::ForEach(&markersRemover); |
222 } | 222 } |
223 | 223 |
224 void SpellCheck::OnEnableSpellCheck(bool enable) { | 224 void SpellCheck::OnEnableSpellCheck(bool enable) { |
| 225 NOTREACHED(); // HACK to see if any try bot tests call here. |
| 226 |
225 spellcheck_enabled_ = enable; | 227 spellcheck_enabled_ = enable; |
226 UpdateSpellcheckEnabled updater(enable); | 228 UpdateSpellcheckEnabled updater(enable); |
227 content::RenderView::ForEach(&updater); | 229 content::RenderView::ForEach(&updater); |
228 } | 230 } |
229 | 231 |
230 // TODO(groby): Make sure we always have a spelling engine, even before | 232 // TODO(groby): Make sure we always have a spelling engine, even before |
231 // AddSpellcheckLanguage() is called. | 233 // AddSpellcheckLanguage() is called. |
232 void SpellCheck::AddSpellcheckLanguage(base::File file, | 234 void SpellCheck::AddSpellcheckLanguage(base::File file, |
233 const std::string& language) { | 235 const std::string& language) { |
234 languages_.push_back(base::MakeUnique<SpellcheckLanguage>()); | 236 languages_.push_back(base::MakeUnique<SpellcheckLanguage>()); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 501 |
500 textcheck_results->Assign(results); | 502 textcheck_results->Assign(results); |
501 } | 503 } |
502 | 504 |
503 bool SpellCheck::IsSpellcheckEnabled() { | 505 bool SpellCheck::IsSpellcheckEnabled() { |
504 #if defined(OS_ANDROID) | 506 #if defined(OS_ANDROID) |
505 if (!spellcheck::IsAndroidSpellCheckFeatureEnabled()) return false; | 507 if (!spellcheck::IsAndroidSpellCheckFeatureEnabled()) return false; |
506 #endif | 508 #endif |
507 return spellcheck_enabled_; | 509 return spellcheck_enabled_; |
508 } | 510 } |
OLD | NEW |