OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 SchedulePaint(); | 326 SchedulePaint(); |
327 NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); | 327 NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); |
328 } | 328 } |
329 | 329 |
330 void Textfield::AppendText(const base::string16& new_text) { | 330 void Textfield::AppendText(const base::string16& new_text) { |
331 if (new_text.empty()) | 331 if (new_text.empty()) |
332 return; | 332 return; |
333 model_->Append(new_text); | 333 model_->Append(new_text); |
334 OnCaretBoundsChanged(); | 334 OnCaretBoundsChanged(); |
335 SchedulePaint(); | 335 SchedulePaint(); |
| 336 NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); |
336 } | 337 } |
337 | 338 |
338 void Textfield::InsertOrReplaceText(const base::string16& new_text) { | 339 void Textfield::InsertOrReplaceText(const base::string16& new_text) { |
339 if (new_text.empty()) | 340 if (new_text.empty()) |
340 return; | 341 return; |
341 model_->InsertText(new_text); | 342 model_->InsertText(new_text); |
342 UpdateAfterChange(true, true); | 343 UpdateAfterChange(true, true); |
343 } | 344 } |
344 | 345 |
345 base::string16 Textfield::GetSelectedText() const { | 346 base::string16 Textfield::GetSelectedText() const { |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 cursor_blink_timer_.Stop(); | 2099 cursor_blink_timer_.Stop(); |
2099 } | 2100 } |
2100 | 2101 |
2101 void Textfield::OnCursorBlinkTimerFired() { | 2102 void Textfield::OnCursorBlinkTimerFired() { |
2102 DCHECK(ShouldBlinkCursor()); | 2103 DCHECK(ShouldBlinkCursor()); |
2103 cursor_view_.SetVisible(!cursor_view_.visible()); | 2104 cursor_view_.SetVisible(!cursor_view_.visible()); |
2104 UpdateCursorViewPosition(); | 2105 UpdateCursorViewPosition(); |
2105 } | 2106 } |
2106 | 2107 |
2107 } // namespace views | 2108 } // namespace views |
OLD | NEW |