summaryrefslogtreecommitdiffstats
path: root/base/i18n/break_iterator.h
diff options
context:
space:
mode:
authorxji@google.com <xji@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 20:32:29 +0000
committerxji@google.com <xji@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 20:32:29 +0000
commit53c0b1ba80612d92849dc02e2e7a1aa97df0e6a1 (patch)
tree28201e71c8163fc73b4b849925bdf87d51bf1636 /base/i18n/break_iterator.h
parentdf09e1b4e119de37af4226a20cd745c209b75f70 (diff)
downloadchromium_src-53c0b1ba80612d92849dc02e2e7a1aa97df0e6a1.zip
chromium_src-53c0b1ba80612d92849dc02e2e7a1aa97df0e6a1.tar.gz
chromium_src-53c0b1ba80612d92849dc02e2e7a1aa97df0e6a1.tar.bz2
This is a reapply of
http://src.chromium.org/viewvc/chrome?view=rev&revision=102006 fix know issues in RenderText 1. add tests. 2. change SelectWord() to use BreakIterator, so it works for Chinese and Complex script. 3. DELETE/ReplaceChar delete/replace a whole grapheme. ReplaceTextInternal should only replace one grapheme when there is no selection. 4. pointing to position outside of text returns HOME/END position. 5. based on Chrome Linux omnibox and gedit, given "abc| def", double click should select " " instead of "abc". Change test expectation. BUG=90426 TEST=compile with touchui=1 test omnibox. run views_unittests.NativeTextfieldViewsTest/TextfieldViewsModelTest Review URL: http://codereview.chromium.org/7841056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/i18n/break_iterator.h')
-rw-r--r--base/i18n/break_iterator.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/i18n/break_iterator.h b/base/i18n/break_iterator.h
index f375962..3207256 100644
--- a/base/i18n/break_iterator.h
+++ b/base/i18n/break_iterator.h
@@ -88,6 +88,12 @@ class BASE_I18N_EXPORT BreakIterator {
// this distinction doesn't apply and it always retuns false.
bool IsWord() const;
+ // Under BREAK_WORD mode, returns true if |position| is at the end of word or
+ // at the start of word. It always retuns false under BREAK_LINE and
+ // BREAK_NEWLINE modes.
+ bool IsEndOfWord(size_t position) const;
+ bool IsStartOfWord(size_t position) const;
+
// Returns the string between prev() and pos().
// Advance() must have been called successfully at least once for pos() to
// have advanced to somewhere useful.