Index: ui/views/controls/textfield/textfield_views_model.cc |
diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc |
index 6d8dd76a4f91906b199b8858f9c2c22167c5cdcc..b26c7f0ba639025eda5abc051fa562adfd8c6d39 100644 |
--- a/ui/views/controls/textfield/textfield_views_model.cc |
+++ b/ui/views/controls/textfield/textfield_views_model.cc |
@@ -315,7 +315,8 @@ bool TextfieldViewsModel::SetText(const string16& text) { |
if (changed) // No need to remember composition. |
Undo(); |
size_t old_cursor = GetCursorPosition(); |
- size_t new_cursor = old_cursor > text.length() ? text.length() : old_cursor; |
+ // SetText moves the cursor to the end. |
+ size_t new_cursor = text.length(); |
SelectAll(); |
// If there is a composition text, don't merge with previous edit. |
// Otherwise, force merge the edits. |