diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-04 03:51:23 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-04 03:51:23 +0000 |
commit | 262fb5ff37c75b8e4b068b813e1e0f2b92239399 (patch) | |
tree | dd276b5cb8eeebedf5a0841ca314c560f91a1c32 /views | |
parent | 28a2912d9aeba1a743af7fabe883ad514f12503e (diff) | |
download | chromium_src-262fb5ff37c75b8e4b068b813e1e0f2b92239399.zip chromium_src-262fb5ff37c75b8e4b068b813e1e0f2b92239399.tar.gz chromium_src-262fb5ff37c75b8e4b068b813e1e0f2b92239399.tar.bz2 |
Fix Regression for Accessible Names appearing as NAMELESS.
The refactoring in r43558 caused SetAccessibleName and GetAccessibleName to be none virtual causing couple of components not having accessible names since they depend on overriding it. The following change sets the accessible name directly since view now stores it.
BUG=40343
TEST=With AccExplorer32 check if accessible names have been resolved.
Review URL: http://codereview.chromium.org/1616004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43584 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/image_view.cc | 7 | ||||
-rw-r--r-- | views/controls/image_view.h | 1 | ||||
-rw-r--r-- | views/controls/label.cc | 7 | ||||
-rw-r--r-- | views/controls/label.h | 1 | ||||
-rw-r--r-- | views/controls/link.cc | 7 | ||||
-rw-r--r-- | views/controls/link.h | 1 |
6 files changed, 2 insertions, 22 deletions
diff --git a/views/controls/image_view.cc b/views/controls/image_view.cc index 4217fe1..d35585e 100644 --- a/views/controls/image_view.cc +++ b/views/controls/image_view.cc @@ -136,12 +136,6 @@ void ImageView::Paint(gfx::Canvas* canvas) { } } -bool ImageView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - *name = tooltip_text_; - return !name->empty(); -} - bool ImageView::GetAccessibleRole(AccessibilityTypes::Role* role) { if (!role) return false; @@ -174,6 +168,7 @@ ImageView::Alignment ImageView::GetVerticalAlignment() { void ImageView::SetTooltipText(const std::wstring& tooltip) { tooltip_text_ = tooltip; + SetAccessibleName(tooltip); } std::wstring ImageView::GetTooltipText() { diff --git a/views/controls/image_view.h b/views/controls/image_view.h index a0da93a..46cbb00 100644 --- a/views/controls/image_view.h +++ b/views/controls/image_view.h @@ -74,7 +74,6 @@ class ImageView : public View { // Overriden from View virtual gfx::Size GetPreferredSize(); virtual void Paint(gfx::Canvas* canvas); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); // Overriden from View. diff --git a/views/controls/label.cc b/views/controls/label.cc index 16b1802..19060f6 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -119,6 +119,7 @@ void Label::SetText(const std::wstring& text) { text_ = text; url_set_ = false; text_size_valid_ = false; + SetAccessibleName(text); SchedulePaint(); } @@ -251,12 +252,6 @@ bool Label::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool Label::GetAccessibleName(std::wstring* name) { - DCHECK(name); - *name = GetText(); - return !name->empty(); -} - bool Label::GetAccessibleState(AccessibilityTypes::State* state) { DCHECK(state); diff --git a/views/controls/label.h b/views/controls/label.h index b2d890e..e68593be 100644 --- a/views/controls/label.h +++ b/views/controls/label.h @@ -173,7 +173,6 @@ class Label : public View { // Accessibility accessors, overridden from View. virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleState(AccessibilityTypes::State* state); // Gets/sets the flag to determine whether the label should be collapsed when diff --git a/views/controls/link.cc b/views/controls/link.cc index 083870c..b258217 100644 --- a/views/controls/link.cc +++ b/views/controls/link.cc @@ -151,13 +151,6 @@ bool Link::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool Link::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - *name = GetText(); - return !name->empty(); -} - void Link::SetFont(const gfx::Font& font) { Label::SetFont(font); ValidateStyle(); diff --git a/views/controls/link.h b/views/controls/link.h index 4ef7af3..75fa877 100644 --- a/views/controls/link.h +++ b/views/controls/link.h @@ -51,7 +51,6 @@ class Link : public Label { // Accessibility accessors, overridden from View: virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); virtual void SetFont(const gfx::Font& font); |