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

Unified Diff: chrome/renderer/spellchecker/spellcheck_worditerator.h

Issue 270203003: Refactor code to avoid direct dependency upon ICU: spellcheck_worditerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactoring_icu_usage
Patch Set: Rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/spellchecker/spellcheck_worditerator.h
diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator.h b/chrome/renderer/spellchecker/spellcheck_worditerator.h
index 09d54a69159f6ded7354c8c154dbd13a6e6a053f..6b6a2f4eac20bc1884c79a2ce1a99aa604aaa09f 100644
--- a/chrome/renderer/spellchecker/spellcheck_worditerator.h
+++ b/chrome/renderer/spellchecker/spellcheck_worditerator.h
@@ -12,10 +12,16 @@
#include <string>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
-#include "third_party/icu/source/common/unicode/ubrk.h"
#include "third_party/icu/source/common/unicode/uscript.h"
+namespace base {
+namespace i18n {
+class BreakIterator;
+} // namespace i18n
+} // namespace base
+
// A class which encapsulates language-specific operations used by
// SpellcheckWordIterator. When we set the spellchecker language, this class
// creates rule sets that filter out the characters not supported by the
@@ -156,18 +162,12 @@ class SpellcheckWordIterator {
// The pointer to the input string from which we are extracting words.
const base::char16* text_;
- // The length of the original string.
- int length_;
-
- // The current position in the original string.
- int position_;
-
// The language-specific attributes used for filtering out non-word
// characters.
const SpellcheckCharAttribute* attribute_;
- // The ICU break iterator.
- UBreakIterator* iterator_;
+ // The break iterator.
+ scoped_ptr<base::i18n::BreakIterator> iterator_;
DISALLOW_COPY_AND_ASSIGN(SpellcheckWordIterator);
};

Powered by Google App Engine
This is Rietveld 408576698