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

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 660633002: Fixed IAccessibleText::TextAtOffset with IA2_TEXT_BOUNDARY_WORD to return text that spans from the … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added semi-automated NVDA test for word navigation and removed dependency on pywinauto. Created 6 years, 1 month 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 (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 "content/browser/accessibility/browser_accessibility_win.h" 5 #include "content/browser/accessibility/browser_accessibility_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 3279 matching lines...) Expand 10 before | Expand all | Expand 10 after
3290 NOTREACHED(); 3290 NOTREACHED();
3291 return ui::CHAR_BOUNDARY; 3291 return ui::CHAR_BOUNDARY;
3292 } 3292 }
3293 } 3293 }
3294 3294
3295 LONG BrowserAccessibilityWin::FindBoundary( 3295 LONG BrowserAccessibilityWin::FindBoundary(
3296 const base::string16& text, 3296 const base::string16& text,
3297 IA2TextBoundaryType ia2_boundary, 3297 IA2TextBoundaryType ia2_boundary,
3298 LONG start_offset, 3298 LONG start_offset,
3299 ui::TextBoundaryDirection direction) { 3299 ui::TextBoundaryDirection direction) {
3300 if (ia2_boundary == IA2_TEXT_BOUNDARY_WORD && IsEditableText())
dmazzoni 2014/11/03 16:26:49 The fact that you're calling IsEditableText() here
3301 return GetWordStartBoundary(static_cast<int>(start_offset), direction);
3302
3300 HandleSpecialTextOffset(text, &start_offset); 3303 HandleSpecialTextOffset(text, &start_offset);
dmazzoni 2014/11/03 16:26:49 I think you should do this call before GetWordStar
3301 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 3304 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
3302 const std::vector<int32>& line_breaks = GetIntListAttribute( 3305 const std::vector<int32>& line_breaks = GetIntListAttribute(
3303 ui::AX_ATTR_LINE_BREAKS); 3306 ui::AX_ATTR_LINE_BREAKS);
3304 return ui::FindAccessibleTextBoundary( 3307 return ui::FindAccessibleTextBoundary(
3305 text, line_breaks, boundary, start_offset, direction); 3308 text, line_breaks, boundary, start_offset, direction);
3306 } 3309 }
3307 3310
3308 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromID(int32 id) { 3311 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromID(int32 id) {
3309 return manager()->GetFromID(id)->ToBrowserAccessibilityWin(); 3312 return manager()->GetFromID(id)->ToBrowserAccessibilityWin();
3310 } 3313 }
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
3857 // The role should always be set. 3860 // The role should always be set.
3858 DCHECK(!role_name_.empty() || ia_role_); 3861 DCHECK(!role_name_.empty() || ia_role_);
3859 3862
3860 // If we didn't explicitly set the IAccessible2 role, make it the same 3863 // If we didn't explicitly set the IAccessible2 role, make it the same
3861 // as the MSAA role. 3864 // as the MSAA role.
3862 if (!ia2_role_) 3865 if (!ia2_role_)
3863 ia2_role_ = ia_role_; 3866 ia2_role_ = ia_role_;
3864 } 3867 }
3865 3868
3866 } // namespace content 3869 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698