| Index: ui/views/controls/textfield/textfield.cc
|
| diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
|
| index 7c7b03534634c075e20a209397b5897961b0bbcf..e46fef351a30a15c5bf6c75aa60fb08576f95506 100644
|
| --- a/ui/views/controls/textfield/textfield.cc
|
| +++ b/ui/views/controls/textfield/textfield.cc
|
| @@ -1771,6 +1771,31 @@ void Textfield::ExecuteTextEditCommand(ui::TextEditCommand command) {
|
| OnAfterUserAction();
|
| }
|
|
|
| +void Textfield::UpdateAfterChange(bool text_changed, bool cursor_changed) {
|
| + if (text_changed) {
|
| + if (controller_)
|
| + controller_->ContentsChanged(this, text());
|
| + NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true);
|
| + }
|
| + if (cursor_changed) {
|
| + GetRenderText()->set_cursor_visible(ShouldShowCursor());
|
| + RepaintCursor();
|
| + if (ShouldBlinkCursor())
|
| + StartBlinkingCursor();
|
| + else
|
| + StopBlinkingCursor();
|
| + if (!text_changed) {
|
| + // TEXT_CHANGED implies TEXT_SELECTION_CHANGED, so we only need to fire
|
| + // this if only the selection changed.
|
| + NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_SELECTION_CHANGED, true);
|
| + }
|
| + }
|
| + if (text_changed || cursor_changed) {
|
| + OnCaretBoundsChanged();
|
| + SchedulePaint();
|
| + }
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // Textfield, private:
|
|
|
| @@ -1798,31 +1823,6 @@ void Textfield::UpdateBackgroundColor() {
|
| SchedulePaint();
|
| }
|
|
|
| -void Textfield::UpdateAfterChange(bool text_changed, bool cursor_changed) {
|
| - if (text_changed) {
|
| - if (controller_)
|
| - controller_->ContentsChanged(this, text());
|
| - NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true);
|
| - }
|
| - if (cursor_changed) {
|
| - GetRenderText()->set_cursor_visible(ShouldShowCursor());
|
| - RepaintCursor();
|
| - if (ShouldBlinkCursor())
|
| - StartBlinkingCursor();
|
| - else
|
| - StopBlinkingCursor();
|
| - if (!text_changed) {
|
| - // TEXT_CHANGED implies TEXT_SELECTION_CHANGED, so we only need to fire
|
| - // this if only the selection changed.
|
| - NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_SELECTION_CHANGED, true);
|
| - }
|
| - }
|
| - if (text_changed || cursor_changed) {
|
| - OnCaretBoundsChanged();
|
| - SchedulePaint();
|
| - }
|
| -}
|
| -
|
| void Textfield::RepaintCursor() {
|
| gfx::Rect r(GetRenderText()->GetUpdatedCursorBounds());
|
| r.Inset(-1, -1, -1, -1);
|
|
|