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

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

Issue 2228833002: MacViews: Fix behavior of move and select commands when selection direction changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_text_commands
Patch Set: Add apple rdar in comment. Created 4 years, 4 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 bdcb55238490a0119c261a06d7c2325528842c12..e51503157490fa0c95dd9ee5baeb334ce05d00ee 100644
--- a/ui/views/controls/textfield/textfield_model.cc
+++ b/ui/views/controls/textfield/textfield_model.cc
@@ -336,9 +336,8 @@ void TextfieldModel::Append(const base::string16& new_text) {
if (HasCompositionText())
ConfirmCompositionText();
size_t save = GetCursorPosition();
- MoveCursor(gfx::LINE_BREAK,
- render_text_->GetVisualDirectionOfLogicalEnd(),
- false);
+ MoveCursor(gfx::LINE_BREAK, render_text_->GetVisualDirectionOfLogicalEnd(),
+ gfx::SELECTION_NONE);
InsertText(new_text);
render_text_->SetCursorPosition(save);
ClearSelection();
@@ -401,10 +400,10 @@ size_t TextfieldModel::GetCursorPosition() const {
void TextfieldModel::MoveCursor(gfx::BreakType break_type,
gfx::VisualCursorDirection direction,
- bool select) {
+ gfx::SelectionBehavior selection_behavior) {
if (HasCompositionText())
ConfirmCompositionText();
- render_text_->MoveCursor(break_type, direction, select);
+ render_text_->MoveCursor(break_type, direction, selection_behavior);
}
bool TextfieldModel::MoveCursorTo(const gfx::SelectionModel& cursor) {

Powered by Google App Engine
This is Rietveld 408576698