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