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

Unified Diff: content/browser/accessibility/browser_accessibility_com_win.cc

Issue 2942413003: Forward BrowserAccessibility::get_accSelection to AXPlatformNode. (Closed)
Patch Set: Break up tests and add a case for mutiple selection Created 3 years, 6 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
Index: content/browser/accessibility/browser_accessibility_com_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_com_win.cc b/content/browser/accessibility/browser_accessibility_com_win.cc
index 8ec9e981b9f157a48844fd71d957dab25cbeaf93..a5dd1aec868dff88d7ef5f1dfb4f83fb00ee606b 100644
--- a/content/browser/accessibility/browser_accessibility_com_win.cc
+++ b/content/browser/accessibility/browser_accessibility_com_win.cc
@@ -685,50 +685,7 @@ STDMETHODIMP BrowserAccessibilityComWin::get_accSelection(VARIANT* selected) {
if (!owner())
return E_FAIL;
- if (owner()->GetRole() != ui::AX_ROLE_LIST_BOX)
- return E_NOTIMPL;
-
- unsigned long selected_count = 0;
- for (size_t i = 0; i < owner()->InternalChildCount(); ++i) {
- if (owner()->InternalGetChild(i)->HasState(ui::AX_STATE_SELECTED))
- ++selected_count;
- }
-
- if (selected_count == 0) {
- selected->vt = VT_EMPTY;
- return S_OK;
- }
-
- if (selected_count == 1) {
- for (size_t i = 0; i < owner()->InternalChildCount(); ++i) {
- if (owner()->InternalGetChild(i)->HasState(ui::AX_STATE_SELECTED)) {
- selected->vt = VT_DISPATCH;
- selected->pdispVal =
- ToBrowserAccessibilityComWin(owner()->InternalGetChild(i))
- ->NewReference();
- return S_OK;
- }
- }
- }
-
- // Multiple items are selected.
- base::win::EnumVariant* enum_variant =
- new base::win::EnumVariant(selected_count);
- enum_variant->AddRef();
- unsigned long index = 0;
- for (size_t i = 0; i < owner()->InternalChildCount(); ++i) {
- if (owner()->InternalGetChild(i)->HasState(ui::AX_STATE_SELECTED)) {
- enum_variant->ItemAt(index)->vt = VT_DISPATCH;
- enum_variant->ItemAt(index)->pdispVal =
- ToBrowserAccessibilityComWin(owner()->InternalGetChild(i))
- ->NewReference();
- ++index;
- }
- }
- selected->vt = VT_UNKNOWN;
- selected->punkVal = static_cast<IUnknown*>(
- static_cast<base::win::IUnknownImpl*>(enum_variant));
- return S_OK;
+ return AXPlatformNodeWin::get_accSelection(selected);
}
STDMETHODIMP BrowserAccessibilityComWin::accSelect(LONG flags_sel,

Powered by Google App Engine
This is Rietveld 408576698