diff options
-rw-r--r-- | views/controls/button/checkbox.cc | 6 | ||||
-rw-r--r-- | views/controls/button/checkbox.h | 1 | ||||
-rw-r--r-- | views/controls/button/native_button.cc | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index f1ae320..65981a4 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -160,12 +160,6 @@ bool Checkbox::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool Checkbox::GetAccessibleName(std::wstring* name) { - DCHECK(name); - *name = label_->GetText(); - return !name->empty(); -} - std::string Checkbox::GetClassName() const { return kViewClassName; } diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index dc58117..a579628 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -59,7 +59,6 @@ class Checkbox : public NativeButton { // Accessibility accessors, overridden from View. virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); // Overridden from NativeButton: virtual void SetLabel(const std::wstring& label); diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc index 7086008..5ff98e8 100644 --- a/views/controls/button/native_button.cc +++ b/views/controls/button/native_button.cc @@ -79,6 +79,9 @@ void NativeButton::SetLabel(const std::wstring& label) { if (native_wrapper_) native_wrapper_->UpdateLabel(); + + // Update the accessible name whenever the label changes. + SetAccessibleName(label); } void NativeButton::SetIsDefault(bool is_default) { |