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 <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 STDMETHODIMP AXPlatformNodeWin::get_indexInParent(LONG* index_in_parent) { | 575 STDMETHODIMP AXPlatformNodeWin::get_indexInParent(LONG* index_in_parent) { |
576 COM_OBJECT_VALIDATE_1_ARG(index_in_parent); | 576 COM_OBJECT_VALIDATE_1_ARG(index_in_parent); |
577 *index_in_parent = GetIndexInParent(); | 577 *index_in_parent = GetIndexInParent(); |
578 if (*index_in_parent < 0) | 578 if (*index_in_parent < 0) |
579 return E_FAIL; | 579 return E_FAIL; |
580 | 580 |
581 return S_OK; | 581 return S_OK; |
582 } | 582 } |
583 | 583 |
584 // | 584 // |
| 585 // IAccessible2 methods not implemented. |
| 586 // |
| 587 |
| 588 STDMETHODIMP AXPlatformNodeWin::get_attribute(BSTR name, VARIANT* attribute) { |
| 589 return E_NOTIMPL; |
| 590 } |
| 591 STDMETHODIMP AXPlatformNodeWin::get_extendedRole(BSTR* extended_role) { |
| 592 return E_NOTIMPL; |
| 593 } |
| 594 STDMETHODIMP AXPlatformNodeWin::get_nRelations(LONG* n_relations) { |
| 595 return E_NOTIMPL; |
| 596 } |
| 597 STDMETHODIMP AXPlatformNodeWin::get_relation(LONG relation_index, |
| 598 IAccessibleRelation** relation) { |
| 599 return E_NOTIMPL; |
| 600 } |
| 601 STDMETHODIMP AXPlatformNodeWin::get_relations(LONG max_relations, |
| 602 IAccessibleRelation** relations, |
| 603 LONG* n_relations) { |
| 604 return E_NOTIMPL; |
| 605 } |
| 606 STDMETHODIMP AXPlatformNodeWin::scrollTo(enum IA2ScrollType scroll_type) { |
| 607 return E_NOTIMPL; |
| 608 } |
| 609 STDMETHODIMP AXPlatformNodeWin::scrollToPoint( |
| 610 enum IA2CoordinateType coordinate_type, |
| 611 LONG x, |
| 612 LONG y) { |
| 613 return E_NOTIMPL; |
| 614 } |
| 615 STDMETHODIMP AXPlatformNodeWin::get_groupPosition(LONG* group_level, |
| 616 LONG* similar_items_in_group, |
| 617 LONG* position_in_group) { |
| 618 return E_NOTIMPL; |
| 619 } |
| 620 STDMETHODIMP AXPlatformNodeWin::get_localizedExtendedRole( |
| 621 BSTR* localized_extended_role) { |
| 622 return E_NOTIMPL; |
| 623 } |
| 624 STDMETHODIMP AXPlatformNodeWin::get_nExtendedStates(LONG* n_extended_states) { |
| 625 return E_NOTIMPL; |
| 626 } |
| 627 STDMETHODIMP AXPlatformNodeWin::get_extendedStates(LONG max_extended_states, |
| 628 BSTR** extended_states, |
| 629 LONG* n_extended_states) { |
| 630 return E_NOTIMPL; |
| 631 } |
| 632 STDMETHODIMP AXPlatformNodeWin::get_localizedExtendedStates( |
| 633 LONG max_localized_extended_states, |
| 634 BSTR** localized_extended_states, |
| 635 LONG* n_localized_extended_states) { |
| 636 return E_NOTIMPL; |
| 637 } |
| 638 STDMETHODIMP AXPlatformNodeWin::get_locale(IA2Locale* locale) { |
| 639 return E_NOTIMPL; |
| 640 } |
| 641 STDMETHODIMP AXPlatformNodeWin::get_accessibleWithCaret(IUnknown** accessible, |
| 642 long* caret_offset) { |
| 643 return E_NOTIMPL; |
| 644 } |
| 645 |
| 646 // |
585 // IAccessibleText | 647 // IAccessibleText |
586 // | 648 // |
587 | 649 |
588 STDMETHODIMP AXPlatformNodeWin::get_nCharacters(LONG* n_characters) { | 650 STDMETHODIMP AXPlatformNodeWin::get_nCharacters(LONG* n_characters) { |
589 COM_OBJECT_VALIDATE_1_ARG(n_characters); | 651 COM_OBJECT_VALIDATE_1_ARG(n_characters); |
590 base::string16 text = TextForIAccessibleText(); | 652 base::string16 text = TextForIAccessibleText(); |
591 *n_characters = static_cast<LONG>(text.size()); | 653 *n_characters = static_cast<LONG>(text.size()); |
592 | 654 |
593 return S_OK; | 655 return S_OK; |
594 } | 656 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 STDMETHODIMP AXPlatformNodeWin::get_offsetAtPoint( | 806 STDMETHODIMP AXPlatformNodeWin::get_offsetAtPoint( |
745 LONG x, LONG y, enum IA2CoordinateType coord_type, LONG* offset) { | 807 LONG x, LONG y, enum IA2CoordinateType coord_type, LONG* offset) { |
746 COM_OBJECT_VALIDATE_1_ARG(offset); | 808 COM_OBJECT_VALIDATE_1_ARG(offset); |
747 // We don't support this method, but we have to return something | 809 // We don't support this method, but we have to return something |
748 // rather than E_NOTIMPL or screen readers will complain. | 810 // rather than E_NOTIMPL or screen readers will complain. |
749 *offset = 0; | 811 *offset = 0; |
750 return S_OK; | 812 return S_OK; |
751 } | 813 } |
752 | 814 |
753 // | 815 // |
| 816 // IAccessibleText methods not implemented. |
| 817 // |
| 818 |
| 819 STDMETHODIMP AXPlatformNodeWin::get_newText(IA2TextSegment* new_text) { |
| 820 return E_NOTIMPL; |
| 821 } |
| 822 STDMETHODIMP AXPlatformNodeWin::get_oldText(IA2TextSegment* old_text) { |
| 823 return E_NOTIMPL; |
| 824 } |
| 825 STDMETHODIMP AXPlatformNodeWin::addSelection(LONG start_offset, |
| 826 LONG end_offset) { |
| 827 return E_NOTIMPL; |
| 828 } |
| 829 STDMETHODIMP AXPlatformNodeWin::get_attributes(LONG offset, |
| 830 LONG* start_offset, |
| 831 LONG* end_offset, |
| 832 BSTR* text_attributes) { |
| 833 return E_NOTIMPL; |
| 834 } |
| 835 STDMETHODIMP AXPlatformNodeWin::get_characterExtents( |
| 836 LONG offset, |
| 837 enum IA2CoordinateType coord_type, |
| 838 LONG* x, |
| 839 LONG* y, |
| 840 LONG* width, |
| 841 LONG* height) { |
| 842 return E_NOTIMPL; |
| 843 } |
| 844 STDMETHODIMP AXPlatformNodeWin::removeSelection(LONG selection_index) { |
| 845 return E_NOTIMPL; |
| 846 } |
| 847 STDMETHODIMP AXPlatformNodeWin::setCaretOffset(LONG offset) { |
| 848 return E_NOTIMPL; |
| 849 } |
| 850 STDMETHODIMP AXPlatformNodeWin::setSelection(LONG selection_index, |
| 851 LONG start_offset, |
| 852 LONG end_offset) { |
| 853 return E_NOTIMPL; |
| 854 } |
| 855 STDMETHODIMP AXPlatformNodeWin::scrollSubstringTo( |
| 856 LONG start_index, |
| 857 LONG end_index, |
| 858 enum IA2ScrollType scroll_type) { |
| 859 return E_NOTIMPL; |
| 860 } |
| 861 STDMETHODIMP AXPlatformNodeWin::scrollSubstringToPoint( |
| 862 LONG start_index, |
| 863 LONG end_index, |
| 864 enum IA2CoordinateType coordinate_type, |
| 865 LONG x, |
| 866 LONG y) { |
| 867 return E_NOTIMPL; |
| 868 } |
| 869 |
| 870 // |
754 // IServiceProvider implementation. | 871 // IServiceProvider implementation. |
755 // | 872 // |
756 | 873 |
757 STDMETHODIMP AXPlatformNodeWin::QueryService( | 874 STDMETHODIMP AXPlatformNodeWin::QueryService( |
758 REFGUID guidService, REFIID riid, void** object) { | 875 REFGUID guidService, REFIID riid, void** object) { |
759 COM_OBJECT_VALIDATE_1_ARG(object); | 876 COM_OBJECT_VALIDATE_1_ARG(object); |
760 if (guidService == IID_IAccessible || | 877 if (guidService == IID_IAccessible || |
761 guidService == IID_IAccessible2 || | 878 guidService == IID_IAccessible2 || |
762 guidService == IID_IAccessible2_2 || | 879 guidService == IID_IAccessible2_2 || |
763 guidService == IID_IAccessibleText) { | 880 guidService == IID_IAccessibleText) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 LONG start_offset, | 1102 LONG start_offset, |
986 ui::TextBoundaryDirection direction) { | 1103 ui::TextBoundaryDirection direction) { |
987 HandleSpecialTextOffset(text, &start_offset); | 1104 HandleSpecialTextOffset(text, &start_offset); |
988 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1105 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
989 std::vector<int32> line_breaks; | 1106 std::vector<int32> line_breaks; |
990 return static_cast<LONG>(ui::FindAccessibleTextBoundary( | 1107 return static_cast<LONG>(ui::FindAccessibleTextBoundary( |
991 text, line_breaks, boundary, start_offset, direction)); | 1108 text, line_breaks, boundary, start_offset, direction)); |
992 } | 1109 } |
993 | 1110 |
994 } // namespace ui | 1111 } // namespace ui |
OLD | NEW |