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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 SchedulePaint(); | 339 SchedulePaint(); |
340 NotifyAccessibilityEvent(ui::AX_EVENT_VALUE_CHANGED, true); | 340 NotifyAccessibilityEvent(ui::AX_EVENT_VALUE_CHANGED, true); |
341 } | 341 } |
342 | 342 |
343 void Textfield::AppendText(const base::string16& new_text) { | 343 void Textfield::AppendText(const base::string16& new_text) { |
344 if (new_text.empty()) | 344 if (new_text.empty()) |
345 return; | 345 return; |
346 model_->Append(new_text); | 346 model_->Append(new_text); |
347 OnCaretBoundsChanged(); | 347 OnCaretBoundsChanged(); |
348 SchedulePaint(); | 348 SchedulePaint(); |
349 NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true); | |
350 } | 349 } |
351 | 350 |
352 void Textfield::InsertOrReplaceText(const base::string16& new_text) { | 351 void Textfield::InsertOrReplaceText(const base::string16& new_text) { |
353 if (new_text.empty()) | 352 if (new_text.empty()) |
354 return; | 353 return; |
355 model_->InsertText(new_text); | 354 model_->InsertText(new_text); |
356 UpdateAfterChange(true, true); | 355 UpdateAfterChange(true, true); |
357 } | 356 } |
358 | 357 |
359 base::string16 Textfield::GetSelectedText() const { | 358 base::string16 Textfield::GetSelectedText() const { |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 cursor_blink_timer_.Stop(); | 2120 cursor_blink_timer_.Stop(); |
2122 } | 2121 } |
2123 | 2122 |
2124 void Textfield::OnCursorBlinkTimerFired() { | 2123 void Textfield::OnCursorBlinkTimerFired() { |
2125 DCHECK(ShouldBlinkCursor()); | 2124 DCHECK(ShouldBlinkCursor()); |
2126 cursor_view_.SetVisible(!cursor_view_.visible()); | 2125 cursor_view_.SetVisible(!cursor_view_.visible()); |
2127 UpdateCursorViewPosition(); | 2126 UpdateCursorViewPosition(); |
2128 } | 2127 } |
2129 | 2128 |
2130 } // namespace views | 2129 } // namespace views |
OLD | NEW |