diff options
Diffstat (limited to 'views/controls/textfield/textfield.cc')
-rw-r--r-- | views/controls/textfield/textfield.cc | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index b650530..7f7251b 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -227,6 +227,40 @@ void Textfield::PaintFocusBorder(gfx::Canvas* canvas) { View::PaintFocusBorder(canvas); } +bool Textfield::GetAccessibleRole(AccessibilityTypes::Role* role) { + DCHECK(role); + if (!role) + return false; + + *role = AccessibilityTypes::ROLE_TEXT; + return true; +} + +bool Textfield::GetAccessibleName(std::wstring* name) { + DCHECK(name); + if (!name) + return false; + + if (!accessible_name_.empty()) { + *name = accessible_name_; + return true; + } + return false; +} + +bool Textfield::GetAccessibleState(AccessibilityTypes::State* state) { + DCHECK(state); + if (!state) + return false; + + *state = AccessibilityTypes::STATE_READONLY; + return true; +} + +void Textfield::SetAccessibleName(const std::wstring& name) { + accessible_name_.assign(name); +} + void Textfield::SetEnabled(bool enabled) { View::SetEnabled(enabled); if (native_wrapper_) |