Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: views/accessibility/view_accessibility.cc

Issue 6310002: Support accDoDefaultAction for NativeButton in ViewAccessibility.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/accessibility/view_accessibility.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « views/accessibility/view_accessibility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698