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

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

Issue 2781613003: Added a class acting as a fake caret for accessibility. (Closed)
Patch Set: Added code that handles views. Created 3 years, 7 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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698