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

Side by Side Diff: ui/accessibility/ax_text_utils.h

Issue 2191833003: Use text affinity to return correct accessible line boundaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug in browser_accessibility_win.cc Created 4 years, 4 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
« no previous file with comments | « ui/accessibility/ax_enums.idl ('k') | ui/accessibility/ax_text_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UI_ACCESSIBILITY_AX_TEXT_UTILS_H_ 5 #ifndef UI_ACCESSIBILITY_AX_TEXT_UTILS_H_
6 #define UI_ACCESSIBILITY_AX_TEXT_UTILS_H_ 6 #define UI_ACCESSIBILITY_AX_TEXT_UTILS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "ui/accessibility/ax_enums.h"
13 #include "ui/accessibility/ax_export.h" 14 #include "ui/accessibility/ax_export.h"
14 15
15 namespace ui { 16 namespace ui {
16 17
17 // Boundaries that can be passed to FindAccessibleTextBoundary, 18 // Boundaries that can be passed to FindAccessibleTextBoundary,
18 // representing various visual boundaries in (potentially multi-line) 19 // representing various visual boundaries in (potentially multi-line)
19 // text. This is used by assistive technology in order to, for example, 20 // text. This is used by assistive technology in order to, for example,
20 // retrieve the nearest word to the cursor, or retrieve all of the 21 // retrieve the nearest word to the cursor, or retrieve all of the
21 // text from the current cursor position to the end of the line. 22 // text from the current cursor position to the end of the line.
22 // These should be self-explanatory; "line" here refers to the visual 23 // These should be self-explanatory; "line" here refers to the visual
(...skipping 18 matching lines...) Expand all
41 // Convenience method needed to implement platform-specific text 42 // Convenience method needed to implement platform-specific text
42 // accessibility APIs like IAccessible2. Search forwards or backwards 43 // accessibility APIs like IAccessible2. Search forwards or backwards
43 // (depending on |direction|) from the given |start_offset| until the 44 // (depending on |direction|) from the given |start_offset| until the
44 // given boundary is found, and return the offset of that boundary, 45 // given boundary is found, and return the offset of that boundary,
45 // using the vector of line break character offsets in |line_breaks|. 46 // using the vector of line break character offsets in |line_breaks|.
46 size_t AX_EXPORT 47 size_t AX_EXPORT
47 FindAccessibleTextBoundary(const base::string16& text, 48 FindAccessibleTextBoundary(const base::string16& text,
48 const std::vector<int>& line_breaks, 49 const std::vector<int>& line_breaks,
49 TextBoundaryType boundary, 50 TextBoundaryType boundary,
50 size_t start_offset, 51 size_t start_offset,
51 TextBoundaryDirection direction); 52 TextBoundaryDirection direction,
53 AXTextAffinity affinity);
52 54
53 } // namespace ui 55 } // namespace ui
54 56
55 #endif // UI_ACCESSIBILITY_AX_TEXT_UTILS_H_ 57 #endif // UI_ACCESSIBILITY_AX_TEXT_UTILS_H_
OLDNEW
« no previous file with comments | « ui/accessibility/ax_enums.idl ('k') | ui/accessibility/ax_text_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698