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

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

Issue 2408623002: Views: Extract text selection code from Textfield. (Closed)
Patch Set: Check for |handles_selection_clipboard_| Created 4 years, 2 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_model.cc
diff --git a/ui/views/controls/textfield/textfield_model.cc b/ui/views/controls/textfield/textfield_model.cc
index dc1bc5539ef39a35a37a72714a9ad13923daf36a..7ca54d4f9b22fc48353ac58318f534894ef67522 100644
--- a/ui/views/controls/textfield/textfield_model.cc
+++ b/ui/views/controls/textfield/textfield_model.cc
@@ -431,10 +431,7 @@ bool TextfieldModel::MoveCursorTo(const gfx::SelectionModel& cursor) {
bool TextfieldModel::MoveCursorTo(const gfx::Point& point, bool select) {
if (HasCompositionText())
ConfirmCompositionText();
- gfx::SelectionModel cursor = render_text_->FindCursorPosition(point);
- if (select)
- cursor.set_selection_start(render_text_->selection().start());
- return render_text_->MoveCursorTo(cursor);
+ return render_text_->MoveCursorTo(point, select);
}
base::string16 TextfieldModel::GetSelectedText() const {

Powered by Google App Engine
This is Rietveld 408576698