| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 "content/browser/accessibility/browser_accessibility_com_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_com_win.h" |
| 6 | 6 |
| 7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
| 8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 return AXPlatformNodeWin::get_accHelp(var_id, help); | 588 return AXPlatformNodeWin::get_accHelp(var_id, help); |
| 589 } | 589 } |
| 590 | 590 |
| 591 STDMETHODIMP BrowserAccessibilityComWin::get_accKeyboardShortcut( | 591 STDMETHODIMP BrowserAccessibilityComWin::get_accKeyboardShortcut( |
| 592 VARIANT var_id, | 592 VARIANT var_id, |
| 593 BSTR* acc_key) { | 593 BSTR* acc_key) { |
| 594 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_KEYBOARD_SHORTCUT); | 594 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_KEYBOARD_SHORTCUT); |
| 595 if (!owner()) | 595 if (!owner()) |
| 596 return E_FAIL; | 596 return E_FAIL; |
| 597 | 597 |
| 598 if (!acc_key) | 598 return AXPlatformNodeWin::get_accKeyboardShortcut(var_id, acc_key); |
| 599 return E_INVALIDARG; | |
| 600 | |
| 601 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); | |
| 602 if (!target) | |
| 603 return E_INVALIDARG; | |
| 604 | |
| 605 if (target->HasStringAttribute(ui::AX_ATTR_KEY_SHORTCUTS)) { | |
| 606 return target->GetStringAttributeAsBstr(ui::AX_ATTR_KEY_SHORTCUTS, acc_key); | |
| 607 } | |
| 608 | |
| 609 return target->GetStringAttributeAsBstr(ui::AX_ATTR_SHORTCUT, acc_key); | |
| 610 } | 599 } |
| 611 | 600 |
| 612 STDMETHODIMP BrowserAccessibilityComWin::get_accName(VARIANT var_id, | 601 STDMETHODIMP BrowserAccessibilityComWin::get_accName(VARIANT var_id, |
| 613 BSTR* name) { | 602 BSTR* name) { |
| 614 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_NAME); | 603 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_NAME); |
| 615 if (!owner()) | 604 if (!owner()) |
| 616 return E_FAIL; | 605 return E_FAIL; |
| 617 | 606 |
| 618 return AXPlatformNodeWin::get_accName(var_id, name); | 607 return AXPlatformNodeWin::get_accName(var_id, name); |
| 619 } | 608 } |
| (...skipping 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5634 | 5623 |
| 5635 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5624 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 5636 BrowserAccessibility* obj) { | 5625 BrowserAccessibility* obj) { |
| 5637 if (!obj || !obj->IsNative()) | 5626 if (!obj || !obj->IsNative()) |
| 5638 return nullptr; | 5627 return nullptr; |
| 5639 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5628 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
| 5640 return result; | 5629 return result; |
| 5641 } | 5630 } |
| 5642 | 5631 |
| 5643 } // namespace content | 5632 } // namespace content |
| OLD | NEW |