| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/accessibility/native_view_accessibility_win.h" | 5 #include "ui/views/accessibility/native_view_accessibility_win.h" |
| 6 | 6 |
| 7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
| 8 #include <oleacc.h> | 8 #include <oleacc.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 STDMETHODIMP NativeViewAccessibilityWin::get_accDefaultAction( | 552 STDMETHODIMP NativeViewAccessibilityWin::get_accDefaultAction( |
| 553 VARIANT var_id, BSTR* def_action) { | 553 VARIANT var_id, BSTR* def_action) { |
| 554 if (!IsValidId(var_id) || !def_action) | 554 if (!IsValidId(var_id) || !def_action) |
| 555 return E_INVALIDARG; | 555 return E_INVALIDARG; |
| 556 | 556 |
| 557 if (!view_) | 557 if (!view_) |
| 558 return E_FAIL; | 558 return E_FAIL; |
| 559 | 559 |
| 560 ui::AccessibleViewState state; | 560 ui::AccessibleViewState state; |
| 561 view_->GetAccessibleState(&state); | 561 view_->GetAccessibleState(&state); |
| 562 string16 temp_action = state.default_action; | 562 base::string16 temp_action = state.default_action; |
| 563 | 563 |
| 564 if (!temp_action.empty()) { | 564 if (!temp_action.empty()) { |
| 565 *def_action = SysAllocString(temp_action.c_str()); | 565 *def_action = SysAllocString(temp_action.c_str()); |
| 566 } else { | 566 } else { |
| 567 return S_FALSE; | 567 return S_FALSE; |
| 568 } | 568 } |
| 569 | 569 |
| 570 return S_OK; | 570 return S_OK; |
| 571 } | 571 } |
| 572 | 572 |
| 573 STDMETHODIMP NativeViewAccessibilityWin::get_accDescription( | 573 STDMETHODIMP NativeViewAccessibilityWin::get_accDescription( |
| 574 VARIANT var_id, BSTR* desc) { | 574 VARIANT var_id, BSTR* desc) { |
| 575 if (!IsValidId(var_id) || !desc) | 575 if (!IsValidId(var_id) || !desc) |
| 576 return E_INVALIDARG; | 576 return E_INVALIDARG; |
| 577 | 577 |
| 578 if (!view_) | 578 if (!view_) |
| 579 return E_FAIL; | 579 return E_FAIL; |
| 580 | 580 |
| 581 string16 temp_desc; | 581 base::string16 temp_desc; |
| 582 | 582 |
| 583 view_->GetTooltipText(gfx::Point(), &temp_desc); | 583 view_->GetTooltipText(gfx::Point(), &temp_desc); |
| 584 if (!temp_desc.empty()) { | 584 if (!temp_desc.empty()) { |
| 585 *desc = SysAllocString(temp_desc.c_str()); | 585 *desc = SysAllocString(temp_desc.c_str()); |
| 586 } else { | 586 } else { |
| 587 return S_FALSE; | 587 return S_FALSE; |
| 588 } | 588 } |
| 589 | 589 |
| 590 return S_OK; | 590 return S_OK; |
| 591 } | 591 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 619 STDMETHODIMP NativeViewAccessibilityWin::get_accKeyboardShortcut( | 619 STDMETHODIMP NativeViewAccessibilityWin::get_accKeyboardShortcut( |
| 620 VARIANT var_id, BSTR* acc_key) { | 620 VARIANT var_id, BSTR* acc_key) { |
| 621 if (!IsValidId(var_id) || !acc_key) | 621 if (!IsValidId(var_id) || !acc_key) |
| 622 return E_INVALIDARG; | 622 return E_INVALIDARG; |
| 623 | 623 |
| 624 if (!view_) | 624 if (!view_) |
| 625 return E_FAIL; | 625 return E_FAIL; |
| 626 | 626 |
| 627 ui::AccessibleViewState state; | 627 ui::AccessibleViewState state; |
| 628 view_->GetAccessibleState(&state); | 628 view_->GetAccessibleState(&state); |
| 629 string16 temp_key = state.keyboard_shortcut; | 629 base::string16 temp_key = state.keyboard_shortcut; |
| 630 | 630 |
| 631 if (!temp_key.empty()) { | 631 if (!temp_key.empty()) { |
| 632 *acc_key = SysAllocString(temp_key.c_str()); | 632 *acc_key = SysAllocString(temp_key.c_str()); |
| 633 } else { | 633 } else { |
| 634 return S_FALSE; | 634 return S_FALSE; |
| 635 } | 635 } |
| 636 | 636 |
| 637 return S_OK; | 637 return S_OK; |
| 638 } | 638 } |
| 639 | 639 |
| 640 STDMETHODIMP NativeViewAccessibilityWin::get_accName( | 640 STDMETHODIMP NativeViewAccessibilityWin::get_accName( |
| 641 VARIANT var_id, BSTR* name) { | 641 VARIANT var_id, BSTR* name) { |
| 642 if (!IsValidId(var_id) || !name) | 642 if (!IsValidId(var_id) || !name) |
| 643 return E_INVALIDARG; | 643 return E_INVALIDARG; |
| 644 | 644 |
| 645 if (!view_) | 645 if (!view_) |
| 646 return E_FAIL; | 646 return E_FAIL; |
| 647 | 647 |
| 648 // Retrieve the current view's name. | 648 // Retrieve the current view's name. |
| 649 ui::AccessibleViewState state; | 649 ui::AccessibleViewState state; |
| 650 view_->GetAccessibleState(&state); | 650 view_->GetAccessibleState(&state); |
| 651 string16 temp_name = state.name; | 651 base::string16 temp_name = state.name; |
| 652 if (!temp_name.empty()) { | 652 if (!temp_name.empty()) { |
| 653 // Return name retrieved. | 653 // Return name retrieved. |
| 654 *name = SysAllocString(temp_name.c_str()); | 654 *name = SysAllocString(temp_name.c_str()); |
| 655 } else { | 655 } else { |
| 656 // If view has no name, return S_FALSE. | 656 // If view has no name, return S_FALSE. |
| 657 return S_FALSE; | 657 return S_FALSE; |
| 658 } | 658 } |
| 659 | 659 |
| 660 return S_OK; | 660 return S_OK; |
| 661 } | 661 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 BSTR* value) { | 728 BSTR* value) { |
| 729 if (!IsValidId(var_id) || !value) | 729 if (!IsValidId(var_id) || !value) |
| 730 return E_INVALIDARG; | 730 return E_INVALIDARG; |
| 731 | 731 |
| 732 if (!view_) | 732 if (!view_) |
| 733 return E_FAIL; | 733 return E_FAIL; |
| 734 | 734 |
| 735 // Retrieve the current view's value. | 735 // Retrieve the current view's value. |
| 736 ui::AccessibleViewState state; | 736 ui::AccessibleViewState state; |
| 737 view_->GetAccessibleState(&state); | 737 view_->GetAccessibleState(&state); |
| 738 string16 temp_value = state.value; | 738 base::string16 temp_value = state.value; |
| 739 | 739 |
| 740 if (!temp_value.empty()) { | 740 if (!temp_value.empty()) { |
| 741 // Return value retrieved. | 741 // Return value retrieved. |
| 742 *value = SysAllocString(temp_value.c_str()); | 742 *value = SysAllocString(temp_value.c_str()); |
| 743 } else { | 743 } else { |
| 744 // If view has no value, fall back into the default implementation. | 744 // If view has no value, fall back into the default implementation. |
| 745 *value = NULL; | 745 *value = NULL; |
| 746 return E_NOTIMPL; | 746 return E_NOTIMPL; |
| 747 } | 747 } |
| 748 | 748 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 // IAccessibleText | 870 // IAccessibleText |
| 871 // | 871 // |
| 872 | 872 |
| 873 STDMETHODIMP NativeViewAccessibilityWin::get_nCharacters(LONG* n_characters) { | 873 STDMETHODIMP NativeViewAccessibilityWin::get_nCharacters(LONG* n_characters) { |
| 874 if (!view_) | 874 if (!view_) |
| 875 return E_FAIL; | 875 return E_FAIL; |
| 876 | 876 |
| 877 if (!n_characters) | 877 if (!n_characters) |
| 878 return E_INVALIDARG; | 878 return E_INVALIDARG; |
| 879 | 879 |
| 880 string16 text = TextForIAccessibleText(); | 880 base::string16 text = TextForIAccessibleText(); |
| 881 *n_characters = static_cast<LONG>(text.size()); | 881 *n_characters = static_cast<LONG>(text.size()); |
| 882 return S_OK; | 882 return S_OK; |
| 883 } | 883 } |
| 884 | 884 |
| 885 STDMETHODIMP NativeViewAccessibilityWin::get_caretOffset(LONG* offset) { | 885 STDMETHODIMP NativeViewAccessibilityWin::get_caretOffset(LONG* offset) { |
| 886 if (!view_) | 886 if (!view_) |
| 887 return E_FAIL; | 887 return E_FAIL; |
| 888 | 888 |
| 889 if (!offset) | 889 if (!offset) |
| 890 return E_INVALIDARG; | 890 return E_INVALIDARG; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 } | 928 } |
| 929 | 929 |
| 930 STDMETHODIMP NativeViewAccessibilityWin::get_text(LONG start_offset, | 930 STDMETHODIMP NativeViewAccessibilityWin::get_text(LONG start_offset, |
| 931 LONG end_offset, | 931 LONG end_offset, |
| 932 BSTR* text) { | 932 BSTR* text) { |
| 933 if (!view_) | 933 if (!view_) |
| 934 return E_FAIL; | 934 return E_FAIL; |
| 935 | 935 |
| 936 ui::AccessibleViewState state; | 936 ui::AccessibleViewState state; |
| 937 view_->GetAccessibleState(&state); | 937 view_->GetAccessibleState(&state); |
| 938 string16 text_str = TextForIAccessibleText(); | 938 base::string16 text_str = TextForIAccessibleText(); |
| 939 LONG len = static_cast<LONG>(text_str.size()); | 939 LONG len = static_cast<LONG>(text_str.size()); |
| 940 | 940 |
| 941 if (start_offset == IA2_TEXT_OFFSET_LENGTH) { | 941 if (start_offset == IA2_TEXT_OFFSET_LENGTH) { |
| 942 start_offset = len; | 942 start_offset = len; |
| 943 } else if (start_offset == IA2_TEXT_OFFSET_CARET) { | 943 } else if (start_offset == IA2_TEXT_OFFSET_CARET) { |
| 944 start_offset = static_cast<LONG>(state.selection_end); | 944 start_offset = static_cast<LONG>(state.selection_end); |
| 945 } | 945 } |
| 946 if (end_offset == IA2_TEXT_OFFSET_LENGTH) { | 946 if (end_offset == IA2_TEXT_OFFSET_LENGTH) { |
| 947 end_offset = static_cast<LONG>(text_str.size()); | 947 end_offset = static_cast<LONG>(text_str.size()); |
| 948 } else if (end_offset == IA2_TEXT_OFFSET_CARET) { | 948 } else if (end_offset == IA2_TEXT_OFFSET_CARET) { |
| 949 end_offset = static_cast<LONG>(state.selection_end); | 949 end_offset = static_cast<LONG>(state.selection_end); |
| 950 } | 950 } |
| 951 | 951 |
| 952 // The spec allows the arguments to be reversed. | 952 // The spec allows the arguments to be reversed. |
| 953 if (start_offset > end_offset) { | 953 if (start_offset > end_offset) { |
| 954 LONG tmp = start_offset; | 954 LONG tmp = start_offset; |
| 955 start_offset = end_offset; | 955 start_offset = end_offset; |
| 956 end_offset = tmp; | 956 end_offset = tmp; |
| 957 } | 957 } |
| 958 | 958 |
| 959 // The spec does not allow the start or end offsets to be out or range; | 959 // The spec does not allow the start or end offsets to be out or range; |
| 960 // we must return an error if so. | 960 // we must return an error if so. |
| 961 if (start_offset < 0) | 961 if (start_offset < 0) |
| 962 return E_INVALIDARG; | 962 return E_INVALIDARG; |
| 963 if (end_offset > len) | 963 if (end_offset > len) |
| 964 return E_INVALIDARG; | 964 return E_INVALIDARG; |
| 965 | 965 |
| 966 string16 substr = text_str.substr(start_offset, end_offset - start_offset); | 966 base::string16 substr = |
| 967 text_str.substr(start_offset, end_offset - start_offset); |
| 967 if (substr.empty()) | 968 if (substr.empty()) |
| 968 return S_FALSE; | 969 return S_FALSE; |
| 969 | 970 |
| 970 *text = SysAllocString(substr.c_str()); | 971 *text = SysAllocString(substr.c_str()); |
| 971 DCHECK(*text); | 972 DCHECK(*text); |
| 972 return S_OK; | 973 return S_OK; |
| 973 } | 974 } |
| 974 | 975 |
| 975 STDMETHODIMP NativeViewAccessibilityWin::get_textAtOffset( | 976 STDMETHODIMP NativeViewAccessibilityWin::get_textAtOffset( |
| 976 LONG offset, | 977 LONG offset, |
| 977 enum IA2TextBoundaryType boundary_type, | 978 enum IA2TextBoundaryType boundary_type, |
| 978 LONG* start_offset, LONG* end_offset, | 979 LONG* start_offset, LONG* end_offset, |
| 979 BSTR* text) { | 980 BSTR* text) { |
| 980 if (!start_offset || !end_offset || !text) | 981 if (!start_offset || !end_offset || !text) |
| 981 return E_INVALIDARG; | 982 return E_INVALIDARG; |
| 982 | 983 |
| 983 // The IAccessible2 spec says we don't have to implement the "sentence" | 984 // The IAccessible2 spec says we don't have to implement the "sentence" |
| 984 // boundary type, we can just let the screenreader handle it. | 985 // boundary type, we can just let the screenreader handle it. |
| 985 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { | 986 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { |
| 986 *start_offset = 0; | 987 *start_offset = 0; |
| 987 *end_offset = 0; | 988 *end_offset = 0; |
| 988 *text = NULL; | 989 *text = NULL; |
| 989 return S_FALSE; | 990 return S_FALSE; |
| 990 } | 991 } |
| 991 | 992 |
| 992 const string16& text_str = TextForIAccessibleText(); | 993 const base::string16& text_str = TextForIAccessibleText(); |
| 993 | 994 |
| 994 *start_offset = FindBoundary( | 995 *start_offset = FindBoundary( |
| 995 text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); | 996 text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); |
| 996 *end_offset = FindBoundary( | 997 *end_offset = FindBoundary( |
| 997 text_str, boundary_type, offset, ui::FORWARDS_DIRECTION); | 998 text_str, boundary_type, offset, ui::FORWARDS_DIRECTION); |
| 998 return get_text(*start_offset, *end_offset, text); | 999 return get_text(*start_offset, *end_offset, text); |
| 999 } | 1000 } |
| 1000 | 1001 |
| 1001 STDMETHODIMP NativeViewAccessibilityWin::get_textBeforeOffset( | 1002 STDMETHODIMP NativeViewAccessibilityWin::get_textBeforeOffset( |
| 1002 LONG offset, | 1003 LONG offset, |
| 1003 enum IA2TextBoundaryType boundary_type, | 1004 enum IA2TextBoundaryType boundary_type, |
| 1004 LONG* start_offset, LONG* end_offset, | 1005 LONG* start_offset, LONG* end_offset, |
| 1005 BSTR* text) { | 1006 BSTR* text) { |
| 1006 if (!start_offset || !end_offset || !text) | 1007 if (!start_offset || !end_offset || !text) |
| 1007 return E_INVALIDARG; | 1008 return E_INVALIDARG; |
| 1008 | 1009 |
| 1009 // The IAccessible2 spec says we don't have to implement the "sentence" | 1010 // The IAccessible2 spec says we don't have to implement the "sentence" |
| 1010 // boundary type, we can just let the screenreader handle it. | 1011 // boundary type, we can just let the screenreader handle it. |
| 1011 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { | 1012 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { |
| 1012 *start_offset = 0; | 1013 *start_offset = 0; |
| 1013 *end_offset = 0; | 1014 *end_offset = 0; |
| 1014 *text = NULL; | 1015 *text = NULL; |
| 1015 return S_FALSE; | 1016 return S_FALSE; |
| 1016 } | 1017 } |
| 1017 | 1018 |
| 1018 const string16& text_str = TextForIAccessibleText(); | 1019 const base::string16& text_str = TextForIAccessibleText(); |
| 1019 | 1020 |
| 1020 *start_offset = FindBoundary( | 1021 *start_offset = FindBoundary( |
| 1021 text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); | 1022 text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); |
| 1022 *end_offset = offset; | 1023 *end_offset = offset; |
| 1023 return get_text(*start_offset, *end_offset, text); | 1024 return get_text(*start_offset, *end_offset, text); |
| 1024 } | 1025 } |
| 1025 | 1026 |
| 1026 STDMETHODIMP NativeViewAccessibilityWin::get_textAfterOffset( | 1027 STDMETHODIMP NativeViewAccessibilityWin::get_textAfterOffset( |
| 1027 LONG offset, | 1028 LONG offset, |
| 1028 enum IA2TextBoundaryType boundary_type, | 1029 enum IA2TextBoundaryType boundary_type, |
| 1029 LONG* start_offset, LONG* end_offset, | 1030 LONG* start_offset, LONG* end_offset, |
| 1030 BSTR* text) { | 1031 BSTR* text) { |
| 1031 if (!start_offset || !end_offset || !text) | 1032 if (!start_offset || !end_offset || !text) |
| 1032 return E_INVALIDARG; | 1033 return E_INVALIDARG; |
| 1033 | 1034 |
| 1034 // The IAccessible2 spec says we don't have to implement the "sentence" | 1035 // The IAccessible2 spec says we don't have to implement the "sentence" |
| 1035 // boundary type, we can just let the screenreader handle it. | 1036 // boundary type, we can just let the screenreader handle it. |
| 1036 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { | 1037 if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) { |
| 1037 *start_offset = 0; | 1038 *start_offset = 0; |
| 1038 *end_offset = 0; | 1039 *end_offset = 0; |
| 1039 *text = NULL; | 1040 *text = NULL; |
| 1040 return S_FALSE; | 1041 return S_FALSE; |
| 1041 } | 1042 } |
| 1042 | 1043 |
| 1043 const string16& text_str = TextForIAccessibleText(); | 1044 const base::string16& text_str = TextForIAccessibleText(); |
| 1044 | 1045 |
| 1045 *start_offset = offset; | 1046 *start_offset = offset; |
| 1046 *end_offset = FindBoundary( | 1047 *end_offset = FindBoundary( |
| 1047 text_str, boundary_type, offset, ui::FORWARDS_DIRECTION); | 1048 text_str, boundary_type, offset, ui::FORWARDS_DIRECTION); |
| 1048 return get_text(*start_offset, *end_offset, text); | 1049 return get_text(*start_offset, *end_offset, text); |
| 1049 } | 1050 } |
| 1050 | 1051 |
| 1051 STDMETHODIMP NativeViewAccessibilityWin::get_offsetAtPoint( | 1052 STDMETHODIMP NativeViewAccessibilityWin::get_offsetAtPoint( |
| 1052 LONG x, LONG y, enum IA2CoordinateType coord_type, LONG* offset) { | 1053 LONG x, LONG y, enum IA2CoordinateType coord_type, LONG* offset) { |
| 1053 if (!view_) | 1054 if (!view_) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 } | 1338 } |
| 1338 if (view->HasFocus()) | 1339 if (view->HasFocus()) |
| 1339 msaa_state->lVal |= STATE_SYSTEM_FOCUSED; | 1340 msaa_state->lVal |= STATE_SYSTEM_FOCUSED; |
| 1340 | 1341 |
| 1341 // Add on any view-specific states. | 1342 // Add on any view-specific states. |
| 1342 ui::AccessibleViewState view_state; | 1343 ui::AccessibleViewState view_state; |
| 1343 view->GetAccessibleState(&view_state); | 1344 view->GetAccessibleState(&view_state); |
| 1344 msaa_state->lVal |= MSAAState(view_state.state); | 1345 msaa_state->lVal |= MSAAState(view_state.state); |
| 1345 } | 1346 } |
| 1346 | 1347 |
| 1347 string16 NativeViewAccessibilityWin::TextForIAccessibleText() { | 1348 base::string16 NativeViewAccessibilityWin::TextForIAccessibleText() { |
| 1348 ui::AccessibleViewState state; | 1349 ui::AccessibleViewState state; |
| 1349 view_->GetAccessibleState(&state); | 1350 view_->GetAccessibleState(&state); |
| 1350 if (state.role == AccessibilityTypes::ROLE_TEXT) | 1351 if (state.role == AccessibilityTypes::ROLE_TEXT) |
| 1351 return state.value; | 1352 return state.value; |
| 1352 else | 1353 else |
| 1353 return state.name; | 1354 return state.name; |
| 1354 } | 1355 } |
| 1355 | 1356 |
| 1356 void NativeViewAccessibilityWin::HandleSpecialTextOffset( | 1357 void NativeViewAccessibilityWin::HandleSpecialTextOffset( |
| 1357 const string16& text, LONG* offset) { | 1358 const base::string16& text, LONG* offset) { |
| 1358 if (*offset == IA2_TEXT_OFFSET_LENGTH) { | 1359 if (*offset == IA2_TEXT_OFFSET_LENGTH) { |
| 1359 *offset = static_cast<LONG>(text.size()); | 1360 *offset = static_cast<LONG>(text.size()); |
| 1360 } else if (*offset == IA2_TEXT_OFFSET_CARET) { | 1361 } else if (*offset == IA2_TEXT_OFFSET_CARET) { |
| 1361 get_caretOffset(offset); | 1362 get_caretOffset(offset); |
| 1362 } | 1363 } |
| 1363 } | 1364 } |
| 1364 | 1365 |
| 1365 ui::TextBoundaryType NativeViewAccessibilityWin::IA2TextBoundaryToTextBoundary( | 1366 ui::TextBoundaryType NativeViewAccessibilityWin::IA2TextBoundaryToTextBoundary( |
| 1366 IA2TextBoundaryType ia2_boundary) { | 1367 IA2TextBoundaryType ia2_boundary) { |
| 1367 switch(ia2_boundary) { | 1368 switch(ia2_boundary) { |
| 1368 case IA2_TEXT_BOUNDARY_CHAR: return ui::CHAR_BOUNDARY; | 1369 case IA2_TEXT_BOUNDARY_CHAR: return ui::CHAR_BOUNDARY; |
| 1369 case IA2_TEXT_BOUNDARY_WORD: return ui::WORD_BOUNDARY; | 1370 case IA2_TEXT_BOUNDARY_WORD: return ui::WORD_BOUNDARY; |
| 1370 case IA2_TEXT_BOUNDARY_LINE: return ui::LINE_BOUNDARY; | 1371 case IA2_TEXT_BOUNDARY_LINE: return ui::LINE_BOUNDARY; |
| 1371 case IA2_TEXT_BOUNDARY_SENTENCE: return ui::SENTENCE_BOUNDARY; | 1372 case IA2_TEXT_BOUNDARY_SENTENCE: return ui::SENTENCE_BOUNDARY; |
| 1372 case IA2_TEXT_BOUNDARY_PARAGRAPH: return ui::PARAGRAPH_BOUNDARY; | 1373 case IA2_TEXT_BOUNDARY_PARAGRAPH: return ui::PARAGRAPH_BOUNDARY; |
| 1373 case IA2_TEXT_BOUNDARY_ALL: return ui::ALL_BOUNDARY; | 1374 case IA2_TEXT_BOUNDARY_ALL: return ui::ALL_BOUNDARY; |
| 1374 default: | 1375 default: |
| 1375 NOTREACHED(); | 1376 NOTREACHED(); |
| 1376 return ui::CHAR_BOUNDARY; | 1377 return ui::CHAR_BOUNDARY; |
| 1377 } | 1378 } |
| 1378 } | 1379 } |
| 1379 | 1380 |
| 1380 LONG NativeViewAccessibilityWin::FindBoundary( | 1381 LONG NativeViewAccessibilityWin::FindBoundary( |
| 1381 const string16& text, | 1382 const base::string16& text, |
| 1382 IA2TextBoundaryType ia2_boundary, | 1383 IA2TextBoundaryType ia2_boundary, |
| 1383 LONG start_offset, | 1384 LONG start_offset, |
| 1384 ui::TextBoundaryDirection direction) { | 1385 ui::TextBoundaryDirection direction) { |
| 1385 HandleSpecialTextOffset(text, &start_offset); | 1386 HandleSpecialTextOffset(text, &start_offset); |
| 1386 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 1387 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
| 1387 std::vector<int32> line_breaks; | 1388 std::vector<int32> line_breaks; |
| 1388 return ui::FindAccessibleTextBoundary( | 1389 return ui::FindAccessibleTextBoundary( |
| 1389 text, line_breaks, boundary, start_offset, direction); | 1390 text, line_breaks, boundary, start_offset, direction); |
| 1390 } | 1391 } |
| 1391 | 1392 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1408 continue; | 1409 continue; |
| 1409 | 1410 |
| 1410 if (widget->GetNativeWindowProperty(kWidgetNativeViewHostKey)) | 1411 if (widget->GetNativeWindowProperty(kWidgetNativeViewHostKey)) |
| 1411 continue; | 1412 continue; |
| 1412 | 1413 |
| 1413 result_child_widgets->push_back(child_widget); | 1414 result_child_widgets->push_back(child_widget); |
| 1414 } | 1415 } |
| 1415 } | 1416 } |
| 1416 | 1417 |
| 1417 } // namespace views | 1418 } // namespace views |
| OLD | NEW |