Index: views/accessibility/view_accessibility.cc |
=================================================================== |
--- views/accessibility/view_accessibility.cc (revision 70902) |
+++ views/accessibility/view_accessibility.cc (working copy) |
@@ -5,6 +5,7 @@ |
#include "views/accessibility/view_accessibility.h" |
#include "app/view_prop.h" |
+#include "views/controls/button/native_button.h" |
#include "views/widget/widget.h" |
#include "views/widget/widget_win.h" |
@@ -83,6 +84,22 @@ |
return S_OK; |
} |
+HRESULT ViewAccessibility::accDoDefaultAction(VARIANT var_id) { |
+ if (!IsValidId(var_id)) |
+ return E_INVALIDARG; |
+ |
+ if (view_->GetClassName() == views::NativeButton::kViewClassName) { |
+ views::NativeButton* native_button = |
+ static_cast<views::NativeButton*>(view_); |
+ native_button->ButtonPressed(); |
+ return S_OK; |
+ } |
+ |
+ // The object does not support the method. This value is returned for |
+ // controls that do not perform actions, such as edit fields. |
+ return DISP_E_MEMBERNOTFOUND; |
+} |
+ |
STDMETHODIMP ViewAccessibility::accLocation( |
LONG* x_left, LONG* y_top, LONG* width, LONG* height, VARIANT var_id) { |
if (!IsValidId(var_id) || !x_left || !y_top || !width || !height) |
@@ -535,10 +552,6 @@ |
// IAccessible functions not supported. |
-HRESULT ViewAccessibility::accDoDefaultAction(VARIANT var_id) { |
- return E_NOTIMPL; |
-} |
- |
STDMETHODIMP ViewAccessibility::get_accSelection(VARIANT* selected) { |
if (selected) |
selected->vt = VT_EMPTY; |