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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 1019663002: Implement AXPlatformNodeWin::get_indexInParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // http://www.linuxfoundation.org/collaborate/workgroups/accessibility/ia2/ia2 _implementation_guide 565 // http://www.linuxfoundation.org/collaborate/workgroups/accessibility/ia2/ia2 _implementation_guide
566 if (GetData().role == ui::AX_ROLE_TEXT_FIELD) { 566 if (GetData().role == ui::AX_ROLE_TEXT_FIELD) {
567 attributes_str = L"text-model:a1;"; 567 attributes_str = L"text-model:a1;";
568 } 568 }
569 569
570 *attributes = SysAllocString(attributes_str.c_str()); 570 *attributes = SysAllocString(attributes_str.c_str());
571 DCHECK(*attributes); 571 DCHECK(*attributes);
572 return S_OK; 572 return S_OK;
573 } 573 }
574 574
575 STDMETHODIMP AXPlatformNodeWin::get_indexInParent(LONG* index_in_parent) {
576 COM_OBJECT_VALIDATE_1_ARG(index_in_parent);
577 *index_in_parent = GetIndexInParent();
578 if (*index_in_parent < 0)
579 return E_FAIL;
580
581 return S_OK;
582 }
583
575 // 584 //
576 // IAccessibleText 585 // IAccessibleText
577 // 586 //
578 587
579 STDMETHODIMP AXPlatformNodeWin::get_nCharacters(LONG* n_characters) { 588 STDMETHODIMP AXPlatformNodeWin::get_nCharacters(LONG* n_characters) {
580 COM_OBJECT_VALIDATE_1_ARG(n_characters); 589 COM_OBJECT_VALIDATE_1_ARG(n_characters);
581 base::string16 text = TextForIAccessibleText(); 590 base::string16 text = TextForIAccessibleText();
582 *n_characters = static_cast<LONG>(text.size()); 591 *n_characters = static_cast<LONG>(text.size());
583 592
584 return S_OK; 593 return S_OK;
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 LONG start_offset, 985 LONG start_offset,
977 ui::TextBoundaryDirection direction) { 986 ui::TextBoundaryDirection direction) {
978 HandleSpecialTextOffset(text, &start_offset); 987 HandleSpecialTextOffset(text, &start_offset);
979 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 988 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
980 std::vector<int32> line_breaks; 989 std::vector<int32> line_breaks;
981 return static_cast<LONG>(ui::FindAccessibleTextBoundary( 990 return static_cast<LONG>(ui::FindAccessibleTextBoundary(
982 text, line_breaks, boundary, start_offset, direction)); 991 text, line_breaks, boundary, start_offset, direction));
983 } 992 }
984 993
985 } // namespace ui 994 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_win.h ('k') | ui/accessibility/platform/ax_platform_node_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698