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 3283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3294 return ui::CHAR_BOUNDARY; | 3294 return ui::CHAR_BOUNDARY; |
3295 } | 3295 } |
3296 } | 3296 } |
3297 | 3297 |
3298 LONG BrowserAccessibilityWin::FindBoundary( | 3298 LONG BrowserAccessibilityWin::FindBoundary( |
3299 const base::string16& text, | 3299 const base::string16& text, |
3300 IA2TextBoundaryType ia2_boundary, | 3300 IA2TextBoundaryType ia2_boundary, |
3301 LONG start_offset, | 3301 LONG start_offset, |
3302 ui::TextBoundaryDirection direction) { | 3302 ui::TextBoundaryDirection direction) { |
3303 HandleSpecialTextOffset(text, &start_offset); | 3303 HandleSpecialTextOffset(text, &start_offset); |
3304 if (ia2_boundary == IA2_TEXT_BOUNDARY_WORD && IsEditableText()) | |
dmazzoni
2014/11/17 19:06:46
Why IsEditableText()? Can't you implement this for
| |
3305 return GetWordStartBoundary(static_cast<int>(start_offset), direction); | |
3306 | |
3304 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); | 3307 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); |
3305 const std::vector<int32>& line_breaks = GetIntListAttribute( | 3308 const std::vector<int32>& line_breaks = GetIntListAttribute( |
3306 ui::AX_ATTR_LINE_BREAKS); | 3309 ui::AX_ATTR_LINE_BREAKS); |
3307 return ui::FindAccessibleTextBoundary( | 3310 return ui::FindAccessibleTextBoundary( |
3308 text, line_breaks, boundary, start_offset, direction); | 3311 text, line_breaks, boundary, start_offset, direction); |
3309 } | 3312 } |
3310 | 3313 |
3311 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromID(int32 id) { | 3314 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromID(int32 id) { |
3312 return manager()->GetFromID(id)->ToBrowserAccessibilityWin(); | 3315 return manager()->GetFromID(id)->ToBrowserAccessibilityWin(); |
3313 } | 3316 } |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3860 // The role should always be set. | 3863 // The role should always be set. |
3861 DCHECK(!role_name_.empty() || ia_role_); | 3864 DCHECK(!role_name_.empty() || ia_role_); |
3862 | 3865 |
3863 // If we didn't explicitly set the IAccessible2 role, make it the same | 3866 // If we didn't explicitly set the IAccessible2 role, make it the same |
3864 // as the MSAA role. | 3867 // as the MSAA role. |
3865 if (!ia2_role_) | 3868 if (!ia2_role_) |
3866 ia2_role_ = ia_role_; | 3869 ia2_role_ = ia_role_; |
3867 } | 3870 } |
3868 | 3871 |
3869 } // namespace content | 3872 } // namespace content |
OLD | NEW |