Index: ui/gfx/render_text_harfbuzz.cc |
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc |
index 32a9e554f60b47127cef9d426aef71a9f410adfa..e83b0a1f0b5d94e810603eb1f5424ac6719ff268 100644 |
--- a/ui/gfx/render_text_harfbuzz.cc |
+++ b/ui/gfx/render_text_harfbuzz.cc |
@@ -842,41 +842,6 @@ SelectionModel RenderTextHarfBuzz::AdjacentWordSelectionModel( |
if (!success) |
return selection; |
- // Match OS specific word break behavior. |
-#if defined(OS_WIN) |
- size_t pos; |
- if (direction == CURSOR_RIGHT) { |
- pos = std::min(selection.caret_pos() + 1, text().length()); |
- while (iter.Advance()) { |
- pos = iter.pos(); |
- if (iter.IsWord() && pos > selection.caret_pos()) |
- break; |
- } |
- } else { // direction == CURSOR_LEFT |
- // Notes: We always iterate words from the beginning. |
- // This is probably fast enough for our usage, but we may |
- // want to modify WordIterator so that it can start from the |
- // middle of string and advance backwards. |
- pos = std::max<int>(selection.caret_pos() - 1, 0); |
- while (iter.Advance()) { |
- if (iter.IsWord()) { |
- size_t begin = iter.pos() - iter.GetString().length(); |
- if (begin == selection.caret_pos()) { |
- // The cursor is at the beginning of a word. |
- // Move to previous word. |
- break; |
- } else if (iter.pos() >= selection.caret_pos()) { |
- // The cursor is in the middle or at the end of a word. |
- // Move to the top of current word. |
- pos = begin; |
- break; |
- } |
- pos = iter.pos() - iter.GetString().length(); |
- } |
- } |
- } |
- return SelectionModel(pos, CURSOR_FORWARD); |
-#else |
internal::TextRunList* run_list = GetRunList(); |
SelectionModel cur(selection); |
for (;;) { |
@@ -891,7 +856,6 @@ SelectionModel RenderTextHarfBuzz::AdjacentWordSelectionModel( |
break; |
} |
return cur; |
-#endif |
} |
std::vector<Rect> RenderTextHarfBuzz::GetSubstringBounds(const Range& range) { |