| 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 "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 Loading... |
| 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()) |
| 3301 return GetWordStartBoundary(static_cast<int>(start_offset), direction); |
| 3302 |
| 3300 HandleSpecialTextOffset(text, &start_offset); | 3303 HandleSpecialTextOffset(text, &start_offset); |
| 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(); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3853 // The role should always be set. | 3856 // The role should always be set. |
| 3854 DCHECK(!role_name_.empty() || ia_role_); | 3857 DCHECK(!role_name_.empty() || ia_role_); |
| 3855 | 3858 |
| 3856 // If we didn't explicitly set the IAccessible2 role, make it the same | 3859 // If we didn't explicitly set the IAccessible2 role, make it the same |
| 3857 // as the MSAA role. | 3860 // as the MSAA role. |
| 3858 if (!ia2_role_) | 3861 if (!ia2_role_) |
| 3859 ia2_role_ = ia_role_; | 3862 ia2_role_ = ia_role_; |
| 3860 } | 3863 } |
| 3861 | 3864 |
| 3862 } // namespace content | 3865 } // namespace content |
| OLD | NEW |