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

Unified Diff: ui/views/controls/textfield/textfield_views_model.cc

Issue 10412009: Enable disabled omnibox tests on aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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: 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.

Powered by Google App Engine
This is Rietveld 408576698