| 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 "chrome/renderer/spellchecker/spellcheck.h" | 5 #include "chrome/renderer/spellchecker/spellcheck.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const std::vector<std::string>& custom_words, | 122 const std::vector<std::string>& custom_words, |
| 123 const std::string& language) { | 123 const std::string& language) { |
| 124 initialized_ = true; | 124 initialized_ = true; |
| 125 hunspell_.reset(); | 125 hunspell_.reset(); |
| 126 bdict_file_.reset(); | 126 bdict_file_.reset(); |
| 127 file_ = file; | 127 file_ = file; |
| 128 is_using_platform_spelling_engine_ = | 128 is_using_platform_spelling_engine_ = |
| 129 file == base::kInvalidPlatformFileValue && !language.empty(); | 129 file == base::kInvalidPlatformFileValue && !language.empty(); |
| 130 | 130 |
| 131 character_attributes_.SetDefaultLanguage(language); | 131 character_attributes_.SetDefaultLanguage(language); |
| 132 text_iterator_.Reset(); |
| 133 contraction_iterator_.Reset(); |
| 132 | 134 |
| 133 custom_words_.insert(custom_words_.end(), | 135 custom_words_.insert(custom_words_.end(), |
| 134 custom_words.begin(), custom_words.end()); | 136 custom_words.begin(), custom_words.end()); |
| 135 | 137 |
| 136 // We delay the actual initialization of hunspell until it is needed. | 138 // We delay the actual initialization of hunspell until it is needed. |
| 137 } | 139 } |
| 138 | 140 |
| 139 bool SpellCheck::SpellCheckWord( | 141 bool SpellCheck::SpellCheckWord( |
| 140 const char16* in_word, | 142 const char16* in_word, |
| 141 int in_word_len, | 143 int in_word_len, |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 } | 516 } |
| 515 } | 517 } |
| 516 list[i] = WebKit::WebTextCheckingResult(type, | 518 list[i] = WebKit::WebTextCheckingResult(type, |
| 517 word_location + line_offset, | 519 word_location + line_offset, |
| 518 word_length, | 520 word_length, |
| 519 spellcheck_results[i].replacement); | 521 spellcheck_results[i].replacement); |
| 520 } | 522 } |
| 521 textcheck_results->swap(list); | 523 textcheck_results->swap(list); |
| 522 } | 524 } |
| 523 #endif | 525 #endif |
| OLD | NEW |