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

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

Issue 2934993002: MacViews a11y: Allow VoiceOver to read out views::Label word-by-word. (Closed)
Patch Set: Fix TextfieldTest.AccessiblePasswordTest Created 3 years, 6 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if (enabled()) { 919 if (enabled()) {
920 node_data->AddIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB, 920 node_data->AddIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB,
921 ui::AX_DEFAULT_ACTION_VERB_ACTIVATE); 921 ui::AX_DEFAULT_ACTION_VERB_ACTIVATE);
922 } 922 }
923 if (read_only()) 923 if (read_only())
924 node_data->AddState(ui::AX_STATE_READ_ONLY); 924 node_data->AddState(ui::AX_STATE_READ_ONLY);
925 else 925 else
926 node_data->AddState(ui::AX_STATE_EDITABLE); 926 node_data->AddState(ui::AX_STATE_EDITABLE);
927 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) { 927 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) {
928 node_data->AddState(ui::AX_STATE_PROTECTED); 928 node_data->AddState(ui::AX_STATE_PROTECTED);
929 node_data->SetValue(base::string16(text().size(), '*')); 929 node_data->SetValue(base::string16(
930 text().size(), gfx::RenderText::kPasswordReplacementChar));
930 } else { 931 } else {
931 node_data->SetValue(text()); 932 node_data->SetValue(text());
932 } 933 }
933 node_data->AddStringAttribute(ui::AX_ATTR_PLACEHOLDER, 934 node_data->AddStringAttribute(ui::AX_ATTR_PLACEHOLDER,
934 base::UTF16ToUTF8(GetPlaceholderText())); 935 base::UTF16ToUTF8(GetPlaceholderText()));
935 936
936 const gfx::Range range = GetSelectedRange(); 937 const gfx::Range range = GetSelectedRange();
937 node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, range.start()); 938 node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, range.start());
938 node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, range.end()); 939 node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, range.end());
939 } 940 }
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.mm ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698