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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 2852763002: Added a system caret used for accessibility on Windows. (Closed)
Patch Set: Disabled all tests Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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
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);
349 } 350 }
350 351
351 void Textfield::InsertOrReplaceText(const base::string16& new_text) { 352 void Textfield::InsertOrReplaceText(const base::string16& new_text) {
352 if (new_text.empty()) 353 if (new_text.empty())
353 return; 354 return;
354 model_->InsertText(new_text); 355 model_->InsertText(new_text);
355 UpdateAfterChange(true, true); 356 UpdateAfterChange(true, true);
356 } 357 }
357 358
358 base::string16 Textfield::GetSelectedText() const { 359 base::string16 Textfield::GetSelectedText() const {
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 cursor_blink_timer_.Stop(); 2121 cursor_blink_timer_.Stop();
2121 } 2122 }
2122 2123
2123 void Textfield::OnCursorBlinkTimerFired() { 2124 void Textfield::OnCursorBlinkTimerFired() {
2124 DCHECK(ShouldBlinkCursor()); 2125 DCHECK(ShouldBlinkCursor());
2125 cursor_view_.SetVisible(!cursor_view_.visible()); 2126 cursor_view_.SetVisible(!cursor_view_.visible());
2126 UpdateCursorViewPosition(); 2127 UpdateCursorViewPosition();
2127 } 2128 }
2128 2129
2129 } // namespace views 2130 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698