Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: components/spellcheck/renderer/spellcheck_worditerator.cc

Issue 2198143002: Componentize spellcheck [3]: move renderer/ files to component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // 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 "components/spellcheck/renderer/spellcheck_worditerator.h"
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <utility> 12 #include <utility>
13 13
14 #include "base/i18n/break_iterator.h" 14 #include "base/i18n/break_iterator.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "chrome/renderer/spellchecker/spellcheck.h" 19 #include "components/spellcheck/renderer/spellcheck.h"
20 #include "third_party/icu/source/common/unicode/normlzr.h" 20 #include "third_party/icu/source/common/unicode/normlzr.h"
21 #include "third_party/icu/source/common/unicode/schriter.h" 21 #include "third_party/icu/source/common/unicode/schriter.h"
22 #include "third_party/icu/source/common/unicode/uscript.h" 22 #include "third_party/icu/source/common/unicode/uscript.h"
23 #include "third_party/icu/source/i18n/unicode/ulocdata.h" 23 #include "third_party/icu/source/i18n/unicode/ulocdata.h"
24 24
25 using base::i18n::BreakIterator; 25 using base::i18n::BreakIterator;
26 26
27 // SpellcheckCharAttribute implementation: 27 // SpellcheckCharAttribute implementation:
28 28
29 SpellcheckCharAttribute::SpellcheckCharAttribute() 29 SpellcheckCharAttribute::SpellcheckCharAttribute()
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 if (status != U_ZERO_ERROR && status != U_STRING_NOT_TERMINATED_WARNING) 436 if (status != U_ZERO_ERROR && status != U_STRING_NOT_TERMINATED_WARNING)
437 return false; 437 return false;
438 438
439 // Copy the normalized text to the output. 439 // Copy the normalized text to the output.
440 icu::StringCharacterIterator it(output); 440 icu::StringCharacterIterator it(output);
441 for (UChar c = it.first(); c != icu::CharacterIterator::DONE; c = it.next()) 441 for (UChar c = it.first(); c != icu::CharacterIterator::DONE; c = it.next())
442 attribute_->OutputChar(c, output_string); 442 attribute_->OutputChar(c, output_string);
443 443
444 return !output_string->empty(); 444 return !output_string->empty();
445 } 445 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698