Chromium Code Reviews| Index: ui/views/controls/textfield/textfield_model.cc |
| diff --git a/ui/views/controls/textfield/textfield_model.cc b/ui/views/controls/textfield/textfield_model.cc |
| index d5bec8b33248d549600280d137186bbcf8557850..c3aafc9206134fe6c3f2ec6a38f1604efe15e20b 100644 |
| --- a/ui/views/controls/textfield/textfield_model.cc |
| +++ b/ui/views/controls/textfield/textfield_model.cc |
| @@ -401,6 +401,18 @@ bool TextfieldModel::MoveCursorTo(const gfx::Point& point, bool select) { |
| return render_text_->MoveCursorTo(cursor); |
| } |
| +void TextfieldModel::MoveCursorToStart(bool select) { |
|
tapted
2016/04/06 23:29:38
I think these are misleading "Start" could be left
Elly Fong-Jones
2016/04/07 17:43:47
Okay, done and removed, and I added a unit test.
|
| + MoveCursor(gfx::BreakType::LINE_BREAK, |
| + gfx::VisualCursorDirection::CURSOR_LEFT, |
| + select); |
| +} |
| + |
| +void TextfieldModel::MoveCursorToEnd(bool select) { |
| + MoveCursor(gfx::BreakType::LINE_BREAK, |
| + gfx::VisualCursorDirection::CURSOR_RIGHT, |
| + select); |
| +} |
| + |
| base::string16 TextfieldModel::GetSelectedText() const { |
| return text().substr(render_text_->selection().GetMin(), |
| render_text_->selection().length()); |