diff options
Diffstat (limited to 'views/controls/textfield/textfield.cc')
-rw-r--r-- | views/controls/textfield/textfield.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index 4366a0c..2a72712 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -12,7 +12,6 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/gfx/insets.h" #include "views/controls/native/native_view_host.h" @@ -281,10 +280,6 @@ size_t Textfield::GetCursorPosition() const { return native_wrapper_ ? native_wrapper_->GetCursorPosition() : 0; } -void Textfield::SetAccessibleName(const string16& name) { - accessible_name_ = name; -} - //////////////////////////////////////////////////////////////////////////////// // Textfield, View overrides: @@ -365,14 +360,23 @@ void Textfield::OnBlur() { native_wrapper_->HandleBlur(); } -void Textfield::GetAccessibleState(ui::AccessibleViewState* state) { - state->role = ui::AccessibilityTypes::ROLE_TEXT; - state->name = accessible_name_; +AccessibilityTypes::Role Textfield::GetAccessibleRole() { + return AccessibilityTypes::ROLE_TEXT; +} + +AccessibilityTypes::State Textfield::GetAccessibleState() { + int state = 0; if (read_only()) - state->state |= ui::AccessibilityTypes::STATE_READONLY; + state |= AccessibilityTypes::STATE_READONLY; if (IsPassword()) - state->state |= ui::AccessibilityTypes::STATE_PROTECTED; - state->value = text_; + state |= AccessibilityTypes::STATE_PROTECTED; + return state; +} + +string16 Textfield::GetAccessibleValue() { + if (!text_.empty()) + return text_; + return string16(); } void Textfield::SetEnabled(bool enabled) { |