OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implements a custom word iterator used for our spellchecker. | 5 // Implements a custom word iterator used for our spellchecker. |
6 | 6 |
7 #include "chrome/renderer/spellchecker/spellcheck_worditerator.h" | 7 #include "chrome/renderer/spellchecker/spellcheck_worditerator.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/logging.h" |
| 14 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
14 #include "chrome/renderer/spellchecker/spellcheck.h" | 16 #include "chrome/renderer/spellchecker/spellcheck.h" |
15 #include "third_party/icu/public/common/unicode/normlzr.h" | 17 #include "third_party/icu/public/common/unicode/normlzr.h" |
16 #include "third_party/icu/public/common/unicode/schriter.h" | 18 #include "third_party/icu/public/common/unicode/schriter.h" |
17 #include "third_party/icu/public/common/unicode/uscript.h" | 19 #include "third_party/icu/public/common/unicode/uscript.h" |
18 #include "third_party/icu/public/i18n/unicode/ulocdata.h" | 20 #include "third_party/icu/public/i18n/unicode/ulocdata.h" |
19 | 21 |
20 // SpellcheckCharAttribute implementation: | 22 // SpellcheckCharAttribute implementation: |
21 | 23 |
22 SpellcheckCharAttribute::SpellcheckCharAttribute() | 24 SpellcheckCharAttribute::SpellcheckCharAttribute() |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 if (status != U_ZERO_ERROR && status != U_STRING_NOT_TERMINATED_WARNING) | 360 if (status != U_ZERO_ERROR && status != U_STRING_NOT_TERMINATED_WARNING) |
359 return false; | 361 return false; |
360 | 362 |
361 // Copy the normalized text to the output. | 363 // Copy the normalized text to the output. |
362 icu::StringCharacterIterator it(output); | 364 icu::StringCharacterIterator it(output); |
363 for (UChar c = it.first(); c != icu::CharacterIterator::DONE; c = it.next()) | 365 for (UChar c = it.first(); c != icu::CharacterIterator::DONE; c = it.next()) |
364 attribute_->OutputChar(c, output_string); | 366 attribute_->OutputChar(c, output_string); |
365 | 367 |
366 return !output_string->empty(); | 368 return !output_string->empty(); |
367 } | 369 } |
368 | |
OLD | NEW |