diff options
Diffstat (limited to 'views/controls/label.cc')
-rw-r--r-- | views/controls/label.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/views/controls/label.cc b/views/controls/label.cc index 6fedc80..1b105f0 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -12,7 +12,6 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/text/text_elider.h" #include "ui/gfx/canvas_skia.h" @@ -107,6 +106,7 @@ void Label::SetText(const std::wstring& text) { text_ = WideToUTF16Hack(text); url_set_ = false; text_size_valid_ = false; + SetAccessibleName(WideToUTF16Hack(text)); PreferredSizeChanged(); SchedulePaint(); } @@ -250,10 +250,12 @@ void Label::SizeToFit(int max_width) { SizeToPreferredSize(); } -void Label::GetAccessibleState(ui::AccessibleViewState* state) { - state->role = ui::AccessibilityTypes::ROLE_STATICTEXT; - state->state = ui::AccessibilityTypes::STATE_READONLY; - state->name = text_; +AccessibilityTypes::Role Label::GetAccessibleRole() { + return AccessibilityTypes::ROLE_STATICTEXT; +} + +AccessibilityTypes::State Label::GetAccessibleState() { + return AccessibilityTypes::STATE_READONLY; } void Label::SetHasFocusBorder(bool has_focus_border) { |