summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield/textfield.cc
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 00:39:07 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 00:39:07 +0000
commitbb837f9287259862c94155cc59cfc9e1bdfe1258 (patch)
treef23a7dabe56a4b4c9288ea022f65c090a4fc536b /views/controls/textfield/textfield.cc
parentd19e63d5bd3a61fc46bae0c527731c79abb94957 (diff)
downloadchromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.zip
chromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.tar.gz
chromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.tar.bz2
Revert 76825 - Refactor Views accessibility.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6581010 TBR=dmazzoni@chromium.org Review URL: http://codereview.chromium.org/6612035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/textfield/textfield.cc')
-rw-r--r--views/controls/textfield/textfield.cc26
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) {