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

Side by Side Diff: content/renderer/accessibility/render_accessibility_impl.h

Issue 2426193003: Re-land: Create AXAction and AXActionData as a way to simplify accessibility actions (Closed)
Patch Set: Rebase Created 4 years, 2 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
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_RENDERER_ACCESSIBILITY_RENDER_ACCESSIBILITY_IMPL_H_ 5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDER_ACCESSIBILITY_IMPL_H_
6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDER_ACCESSIBILITY_IMPL_H_ 6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDER_ACCESSIBILITY_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "content/common/ax_content_node_data.h" 13 #include "content/common/ax_content_node_data.h"
14 #include "content/public/renderer/render_accessibility.h" 14 #include "content/public/renderer/render_accessibility.h"
15 #include "content/public/renderer/render_frame_observer.h" 15 #include "content/public/renderer/render_frame_observer.h"
16 #include "content/renderer/accessibility/blink_ax_tree_source.h" 16 #include "content/renderer/accessibility/blink_ax_tree_source.h"
17 #include "third_party/WebKit/public/web/WebAXObject.h" 17 #include "third_party/WebKit/public/web/WebAXObject.h"
18 #include "ui/accessibility/ax_relative_bounds.h" 18 #include "ui/accessibility/ax_relative_bounds.h"
19 #include "ui/accessibility/ax_tree.h" 19 #include "ui/accessibility/ax_tree.h"
20 #include "ui/accessibility/ax_tree_serializer.h" 20 #include "ui/accessibility/ax_tree_serializer.h"
21 #include "ui/gfx/geometry/rect_f.h" 21 #include "ui/gfx/geometry/rect_f.h"
22 22
23 struct AccessibilityHostMsg_EventParams; 23 struct AccessibilityHostMsg_EventParams;
24 24
25 namespace blink { 25 namespace blink {
26 class WebDocument; 26 class WebDocument;
27 class WebNode; 27 class WebNode;
28 }; 28 };
29 29
30 namespace ui {
31 struct AXActionData;
32 }
33
30 namespace content { 34 namespace content {
31 class RenderFrameImpl; 35 class RenderFrameImpl;
32 36
33 // The browser process implements native accessibility APIs, allowing 37 // The browser process implements native accessibility APIs, allowing
34 // assistive technology (e.g., screen readers, magnifiers) to access and 38 // assistive technology (e.g., screen readers, magnifiers) to access and
35 // control the web contents with high-level APIs. These APIs are also used 39 // control the web contents with high-level APIs. These APIs are also used
36 // by automation tools, and Windows 8 uses them to determine when the 40 // by automation tools, and Windows 8 uses them to determine when the
37 // on-screen keyboard should be shown. 41 // on-screen keyboard should be shown.
38 // 42 //
39 // An instance of this class belongs to RenderFrameImpl. Accessibility is 43 // An instance of this class belongs to RenderFrameImpl. Accessibility is
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void SendLocationChanges(); 112 void SendLocationChanges();
109 113
110 // The RenderFrameImpl that owns us. 114 // The RenderFrameImpl that owns us.
111 RenderFrameImpl* render_frame_; 115 RenderFrameImpl* render_frame_;
112 116
113 private: 117 private:
114 // RenderFrameObserver implementation. 118 // RenderFrameObserver implementation.
115 void OnDestruct() override; 119 void OnDestruct() override;
116 120
117 // Handlers for messages from the browser to the renderer. 121 // Handlers for messages from the browser to the renderer.
118 void OnDoDefaultAction(int acc_obj_id); 122 void OnPerformAction(const ui::AXActionData& data);
119 void OnEventsAck(int ack_token); 123 void OnEventsAck(int ack_token);
120 void OnFatalError(); 124 void OnFatalError();
121 void OnHitTest(gfx::Point point);
122 void OnSetAccessibilityFocus(int acc_obj_id);
123 void OnReset(int reset_token); 125 void OnReset(int reset_token);
124 void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus);
125 void OnScrollToPoint(int acc_obj_id, gfx::Point point);
126 void OnSetScrollOffset(int acc_obj_id, gfx::Point offset);
127 void OnSetFocus(int acc_obj_id);
128 void OnSetSelection(int anchor_acc_obj_id,
129 int anchor_offset,
130 int focus_acc_obj_id,
131 int focus_offset);
132 void OnSetValue(int acc_obj_id, base::string16 value);
133 void OnShowContextMenu(int acc_obj_id);
134 126
127 void OnHitTest(const gfx::Point& point);
128 void OnSetAccessibilityFocus(const blink::WebAXObject& obj);
135 void AddPluginTreeToUpdate(AXContentTreeUpdate* update); 129 void AddPluginTreeToUpdate(AXContentTreeUpdate* update);
136 void ScrollPlugin(int id_to_make_visible); 130 void ScrollPlugin(int id_to_make_visible);
137 131
138 // Events from Blink are collected until they are ready to be 132 // Events from Blink are collected until they are ready to be
139 // sent to the browser. 133 // sent to the browser.
140 std::vector<AccessibilityHostMsg_EventParams> pending_events_; 134 std::vector<AccessibilityHostMsg_EventParams> pending_events_;
141 135
142 // The adapter that exposes Blink's accessibility tree to AXTreeSerializer. 136 // The adapter that exposes Blink's accessibility tree to AXTreeSerializer.
143 BlinkAXTreeSource tree_source_; 137 BlinkAXTreeSource tree_source_;
144 138
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 172
179 // So we can queue up tasks to be executed later. 173 // So we can queue up tasks to be executed later.
180 base::WeakPtrFactory<RenderAccessibilityImpl> weak_factory_; 174 base::WeakPtrFactory<RenderAccessibilityImpl> weak_factory_;
181 175
182 DISALLOW_COPY_AND_ASSIGN(RenderAccessibilityImpl); 176 DISALLOW_COPY_AND_ASSIGN(RenderAccessibilityImpl);
183 }; 177 };
184 178
185 } // namespace content 179 } // namespace content
186 180
187 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ 181 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_
OLDNEW
« no previous file with comments | « content/public/browser/render_frame_host.h ('k') | content/renderer/accessibility/render_accessibility_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698