| 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/custom_dictionary_engine.h" | 5 #include "components/spellcheck/renderer/custom_dictionary_engine.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 | 10 |
| 11 CustomDictionaryEngine::CustomDictionaryEngine() { | 11 CustomDictionaryEngine::CustomDictionaryEngine() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 CustomDictionaryEngine::~CustomDictionaryEngine() { | 14 CustomDictionaryEngine::~CustomDictionaryEngine() { |
| 15 } | 15 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 40 int misspelling_start, | 40 int misspelling_start, |
| 41 int misspelling_len) { | 41 int misspelling_len) { |
| 42 // The text to be checked is empty on OSX(async) right now. | 42 // The text to be checked is empty on OSX(async) right now. |
| 43 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241) | 43 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241) |
| 44 return | 44 return |
| 45 misspelling_start >= 0 && | 45 misspelling_start >= 0 && |
| 46 misspelling_len > 0 && | 46 misspelling_len > 0 && |
| 47 size_t(misspelling_start + misspelling_len) <= text.length() && | 47 size_t(misspelling_start + misspelling_len) <= text.length() && |
| 48 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0; | 48 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0; |
| 49 } | 49 } |
| OLD | NEW |