Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2373403002: views: update textfield cursor state after programmatic text changes (Closed)
Patch Set: remove spurious update calls Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 4642d23fc89a89633cc84ff72fbb5011959a7b9d..524280ef2e01d7eee8555a1e1af6c3b336ce003e 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -306,25 +306,21 @@ void Textfield::SetTextInputFlags(int flags) {
void Textfield::SetText(const base::string16& new_text) {
model_->SetText(new_text);
- OnCaretBoundsChanged();
- SchedulePaint();
- NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true);
+ UpdateAfterChange(true, true);
}
void Textfield::AppendText(const base::string16& new_text) {
if (new_text.empty())
return;
model_->Append(new_text);
- OnCaretBoundsChanged();
- SchedulePaint();
+ UpdateAfterChange(true, true);
}
void Textfield::InsertOrReplaceText(const base::string16& new_text) {
if (new_text.empty())
return;
model_->InsertText(new_text);
- OnCaretBoundsChanged();
- SchedulePaint();
+ UpdateAfterChange(true, true);
}
base::string16 Textfield::GetSelectedText() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698