| Index: ui/views/controls/textfield/textfield.cc
|
| diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
|
| index ca39c99c49aac957362be449e6fbe36647eb69a9..b71994d54bba9fa897ec66c1e8a6926c96ed7ffc 100644
|
| --- a/ui/views/controls/textfield/textfield.cc
|
| +++ b/ui/views/controls/textfield/textfield.cc
|
| @@ -1860,18 +1860,12 @@ void Textfield::PasteSelectionClipboard(const ui::MouseEvent& event) {
|
| base::string16 selection_clipboard_text = GetSelectionClipboardText();
|
| if (!selection_clipboard_text.empty()) {
|
| OnBeforeUserAction();
|
| - gfx::Range range = GetSelectionModel().selection();
|
| - gfx::LogicalCursorDirection affinity = GetSelectionModel().caret_affinity();
|
| const gfx::SelectionModel mouse =
|
| GetRenderText()->FindCursorPosition(event.location());
|
| + if (!HasFocus())
|
| + RequestFocus();
|
| model_->MoveCursorTo(mouse);
|
| model_->InsertText(selection_clipboard_text);
|
| - // Update the new selection range as needed.
|
| - if (range.GetMin() >= mouse.caret_pos()) {
|
| - const size_t length = selection_clipboard_text.length();
|
| - range = gfx::Range(range.start() + length, range.end() + length);
|
| - }
|
| - model_->MoveCursorTo(gfx::SelectionModel(range, affinity));
|
| UpdateAfterChange(true, true);
|
| OnAfterUserAction();
|
| }
|
|
|