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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.h

Issue 2447013009: Implement Increment and Decrement accessible actions (Closed)
Patch Set: Change to make test pass on Android Created 4 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Called to notify the accessibility manager that its associated native 165 // Called to notify the accessibility manager that its associated native
166 // view lost focus. 166 // view lost focus.
167 virtual void OnWindowBlurred(); 167 virtual void OnWindowBlurred();
168 168
169 // Notify the accessibility manager about page navigation. 169 // Notify the accessibility manager about page navigation.
170 void UserIsNavigatingAway(); 170 void UserIsNavigatingAway();
171 virtual void UserIsReloading(); 171 virtual void UserIsReloading();
172 void NavigationSucceeded(); 172 void NavigationSucceeded();
173 void NavigationFailed(); 173 void NavigationFailed();
174 174
175 // Send a message to the renderer to set focus to this node.
176 void SetFocus(const BrowserAccessibility& node);
177
178 // Pretend that the given node has focus, for testing only. Doesn't 175 // Pretend that the given node has focus, for testing only. Doesn't
179 // communicate with the renderer and doesn't fire any events. 176 // communicate with the renderer and doesn't fire any events.
180 void SetFocusLocallyForTesting(BrowserAccessibility* node); 177 void SetFocusLocallyForTesting(BrowserAccessibility* node);
181 178
182 // For testing only, register a function to be called when focus changes 179 // For testing only, register a function to be called when focus changes
183 // in any BrowserAccessibilityManager. 180 // in any BrowserAccessibilityManager.
184 static void SetFocusChangeCallbackForTesting(const base::Closure& callback); 181 static void SetFocusChangeCallbackForTesting(const base::Closure& callback);
185 182
186 // Tell the renderer to do the default action for this node. 183 // Accessibility actions. All of these are implemented asynchronously
184 // by sending a message to the renderer to perform the respective action
185 // on the given node. See the definition of |ui::AXActionData| for more
186 // information about each of these actions.
187 void Decrement(const BrowserAccessibility& node);
187 void DoDefaultAction(const BrowserAccessibility& node); 188 void DoDefaultAction(const BrowserAccessibility& node);
188 189 void HitTest(const gfx::Point& point);
189 // Tell the renderer to show the context menu for a given node. 190 void Increment(const BrowserAccessibility& node);
190 void ShowContextMenu(const BrowserAccessibility& node);
191
192 // Tell the renderer to scroll to make |node| visible.
193 // In addition, if it's not possible to make the entire object visible,
194 // scroll so that the |subfocus| rect is visible at least. The subfocus
195 // rect is in local coordinates of the object itself.
196 void ScrollToMakeVisible( 191 void ScrollToMakeVisible(
197 const BrowserAccessibility& node, gfx::Rect subfocus); 192 const BrowserAccessibility& node, gfx::Rect subfocus);
198
199 // Tell the renderer to scroll such that |node| is at |point|,
200 // where |point| is in global coordinates of the WebContents.
201 void ScrollToPoint( 193 void ScrollToPoint(
202 const BrowserAccessibility& node, gfx::Point point); 194 const BrowserAccessibility& node, gfx::Point point);
203 195 void SetFocus(const BrowserAccessibility& node);
204 // If |node| is itself a scrollable container, set its scroll
205 // offset to |offset|.
206 void SetScrollOffset(const BrowserAccessibility& node, gfx::Point offset); 196 void SetScrollOffset(const BrowserAccessibility& node, gfx::Point offset);
207
208 // Tell the renderer to set the value of an editable text node.
209 void SetValue( 197 void SetValue(
210 const BrowserAccessibility& node, const base::string16& value); 198 const BrowserAccessibility& node, const base::string16& value);
211
212 // Tell the renderer to set the text selection on a node.
213 void SetTextSelection( 199 void SetTextSelection(
214 const BrowserAccessibility& node, int start_offset, int end_offset); 200 const BrowserAccessibility& node, int start_offset, int end_offset);
215
216 // Tell the renderer to set accessibility focus to this node.
217 void SetAccessibilityFocus(const BrowserAccessibility& node); 201 void SetAccessibilityFocus(const BrowserAccessibility& node);
218 202 void ShowContextMenu(const BrowserAccessibility& node);
219 // Tell the renderer to do a hit test on a point in global screen coordinates
220 // and fire a HOVER event on the node that's hit.
221 void HitTest(const gfx::Point& point);
222 203
223 // Retrieve the bounds of the parent View in screen coordinates. 204 // Retrieve the bounds of the parent View in screen coordinates.
224 gfx::Rect GetViewBounds(); 205 gfx::Rect GetViewBounds();
225 206
226 // Fire an event telling native assistive technology to move focus to the 207 // Fire an event telling native assistive technology to move focus to the
227 // given find in page result. 208 // given find in page result.
228 void ActivateFindInPageResult(int request_id, int match_index); 209 void ActivateFindInPageResult(int request_id, int match_index);
229 210
230 // Called when the renderer process has notified us of about tree changes. 211 // Called when the renderer process has notified us of about tree changes.
231 virtual void OnAccessibilityEvents( 212 virtual void OnAccessibilityEvents(
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // node within that parent tree. It's computed as needed and cached for 459 // node within that parent tree. It's computed as needed and cached for
479 // speed so that it can be accessed quickly if it hasn't changed. 460 // speed so that it can be accessed quickly if it hasn't changed.
480 int parent_node_id_from_parent_tree_; 461 int parent_node_id_from_parent_tree_;
481 462
482 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); 463 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager);
483 }; 464 };
484 465
485 } // namespace content 466 } // namespace content
486 467
487 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ 468 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698