summaryrefslogtreecommitdiffstats
path: root/views/controls/label.cc
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 06:56:33 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 06:56:33 +0000
commit79e549faf26611d5ac05bc4f7fefd4a71a23fcb2 (patch)
treee7c50ebe8d193233ce2b06bbf5751bb9e82115b7 /views/controls/label.cc
parent36096983abafe5aa7a1df56904db3c0c8fa9ee2e (diff)
downloadchromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.zip
chromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.tar.gz
chromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.tar.bz2
Re-land: Refactor Views accessibility.
BUG=74988 TEST=none Review URL: http://codereview.chromium.org/6581010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/label.cc')
-rw-r--r--views/controls/label.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/views/controls/label.cc b/views/controls/label.cc
index a428bcd..21510af 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -12,6 +12,7 @@
#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"
@@ -106,7 +107,6 @@ void Label::SetText(const std::wstring& text) {
text_ = WideToUTF16Hack(text);
url_set_ = false;
text_size_valid_ = false;
- SetAccessibleName(WideToUTF16Hack(text));
PreferredSizeChanged();
SchedulePaint();
}
@@ -258,12 +258,10 @@ void Label::SizeToFit(int max_width) {
SizeToPreferredSize();
}
-AccessibilityTypes::Role Label::GetAccessibleRole() {
- return AccessibilityTypes::ROLE_STATICTEXT;
-}
-
-AccessibilityTypes::State Label::GetAccessibleState() {
- return AccessibilityTypes::STATE_READONLY;
+void Label::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_STATICTEXT;
+ state->state = ui::AccessibilityTypes::STATE_READONLY;
+ state->name = text_;
}
void Label::SetHasFocusBorder(bool has_focus_border) {