OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 COM_OBJECT_VALIDATE_VAR_ID_AND_GET_TARGET(var_id, target); | 531 COM_OBJECT_VALIDATE_VAR_ID_AND_GET_TARGET(var_id, target); |
532 | 532 |
533 AXActionData data; | 533 AXActionData data; |
534 data.action = ui::AX_ACTION_SET_VALUE; | 534 data.action = ui::AX_ACTION_SET_VALUE; |
535 data.value = new_value; | 535 data.value = new_value; |
536 if (target->delegate_->AccessibilityPerformAction(data)) | 536 if (target->delegate_->AccessibilityPerformAction(data)) |
537 return S_OK; | 537 return S_OK; |
538 return E_FAIL; | 538 return E_FAIL; |
539 } | 539 } |
540 | 540 |
541 // IAccessible functions not supported. | |
542 | |
543 STDMETHODIMP AXPlatformNodeWin::get_accSelection(VARIANT* selected) { | 541 STDMETHODIMP AXPlatformNodeWin::get_accSelection(VARIANT* selected) { |
544 COM_OBJECT_VALIDATE_1_ARG(selected); | 542 COM_OBJECT_VALIDATE_1_ARG(selected); |
545 if (selected) | 543 if (selected) |
546 selected->vt = VT_EMPTY; | 544 selected->vt = VT_EMPTY; |
547 return E_NOTIMPL; | 545 return E_NOTIMPL; |
548 } | 546 } |
549 | 547 |
550 STDMETHODIMP AXPlatformNodeWin::accSelect( | 548 STDMETHODIMP AXPlatformNodeWin::accSelect( |
551 LONG flagsSelect, VARIANT var_id) { | 549 LONG flagsSelect, VARIANT var_id) { |
552 return E_NOTIMPL; | 550 AXPlatformNodeWin* target; |
| 551 COM_OBJECT_VALIDATE_VAR_ID_AND_GET_TARGET(var_id, target); |
| 552 |
| 553 if (flagsSelect & SELFLAG_TAKEFOCUS) { |
| 554 ui::AXActionData action_data; |
| 555 action_data.action = ui::AX_ACTION_FOCUS; |
| 556 target->delegate_->AccessibilityPerformAction(action_data); |
| 557 return S_OK; |
| 558 } |
| 559 |
| 560 return S_FALSE; |
553 } | 561 } |
554 | 562 |
555 STDMETHODIMP AXPlatformNodeWin::get_accHelpTopic( | 563 STDMETHODIMP AXPlatformNodeWin::get_accHelpTopic( |
556 BSTR* help_file, VARIANT var_id, LONG* topic_id) { | 564 BSTR* help_file, VARIANT var_id, LONG* topic_id) { |
557 AXPlatformNodeWin* target; | 565 AXPlatformNodeWin* target; |
558 COM_OBJECT_VALIDATE_VAR_ID_2_ARGS_AND_GET_TARGET(var_id, help_file, topic_id, | 566 COM_OBJECT_VALIDATE_VAR_ID_2_ARGS_AND_GET_TARGET(var_id, help_file, topic_id, |
559 target); | 567 target); |
560 if (help_file) { | 568 if (help_file) { |
561 *help_file = nullptr; | 569 *help_file = nullptr; |
562 } | 570 } |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 | 1301 |
1294 AXPlatformNodeBase* base = | 1302 AXPlatformNodeBase* base = |
1295 FromNativeViewAccessible(node->GetNativeViewAccessible()); | 1303 FromNativeViewAccessible(node->GetNativeViewAccessible()); |
1296 if (base && !IsDescendant(base)) | 1304 if (base && !IsDescendant(base)) |
1297 base = nullptr; | 1305 base = nullptr; |
1298 | 1306 |
1299 return static_cast<AXPlatformNodeWin*>(base); | 1307 return static_cast<AXPlatformNodeWin*>(base); |
1300 } | 1308 } |
1301 | 1309 |
1302 } // namespace ui | 1310 } // namespace ui |
OLD | NEW |