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

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

Issue 2522543004: Add support for retrieving image thumbnails as part of the accessibility tree. (Closed)
Patch Set: Fix test failure and add automation apitest Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BLINK_AX_TREE_SOURCE_H_ 5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
6 #define CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 6 #define CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "content/common/ax_content_node_data.h" 10 #include "content/common/ax_content_node_data.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void Thaw(); 47 void Thaw();
48 48
49 // It may be necessary to call SetRoot if you're using a WebScopedAXContext, 49 // It may be necessary to call SetRoot if you're using a WebScopedAXContext,
50 // because BlinkAXTreeSource can't get the root of the tree from the 50 // because BlinkAXTreeSource can't get the root of the tree from the
51 // WebDocument if accessibility isn't enabled globally. 51 // WebDocument if accessibility isn't enabled globally.
52 void SetRoot(blink::WebAXObject root); 52 void SetRoot(blink::WebAXObject root);
53 53
54 // Walks up the ancestor chain to see if this is a descendant of the root. 54 // Walks up the ancestor chain to see if this is a descendant of the root.
55 bool IsInTree(blink::WebAXObject node) const; 55 bool IsInTree(blink::WebAXObject node) const;
56 56
57 // Set the id of the node to fetch image data for. Normally the content
58 // of images is not part of the accessibility tree, but one node at a
59 // time can be designated
aboxhall 2016/11/22 19:06:31 Unfinished sentence?
dmazzoni 2016/11/22 22:00:13 Done.
60 int image_data_node_id() { return image_data_node_id_; }
61 void set_image_data_node_id(int id) { image_data_node_id_ = id; }
62
63 void set_max_image_data_size(const gfx::Size& size) {
64 max_image_data_size_ = size;
65 }
66
57 // Set the id of the node with accessibility focus. The node with 67 // Set the id of the node with accessibility focus. The node with
58 // accessibility focus will force loading inline text box children, 68 // accessibility focus will force loading inline text box children,
59 // which aren't always loaded by default on all platforms. 69 // which aren't always loaded by default on all platforms.
60 int accessibility_focus_id() { return accessibility_focus_id_; } 70 int accessibility_focus_id() { return accessibility_focus_id_; }
61 void set_accessibility_focus_id(int id) { accessibility_focus_id_ = id; } 71 void set_accessibility_focus_id(int id) { accessibility_focus_id_ = id; }
62 72
63 // AXTreeSource implementation. 73 // AXTreeSource implementation.
64 bool GetTreeData(AXContentTreeData* tree_data) const override; 74 bool GetTreeData(AXContentTreeData* tree_data) const override;
65 blink::WebAXObject GetRoot() const override; 75 blink::WebAXObject GetRoot() const override;
66 blink::WebAXObject GetFromId(int32_t id) const override; 76 blink::WebAXObject GetFromId(int32_t id) const override;
(...skipping 26 matching lines...) Expand all
93 } 103 }
94 104
95 blink::WebAXObject ComputeRoot() const; 105 blink::WebAXObject ComputeRoot() const;
96 106
97 RenderFrameImpl* render_frame_; 107 RenderFrameImpl* render_frame_;
98 108
99 // An explicit root to use, otherwise it's taken from the WebDocument. 109 // An explicit root to use, otherwise it's taken from the WebDocument.
100 blink::WebAXObject explicit_root_; 110 blink::WebAXObject explicit_root_;
101 111
102 // The id of the object with accessibility focus. 112 // The id of the object with accessibility focus.
103 int accessibility_focus_id_; 113 int accessibility_focus_id_ = -1;
114
115 // THe id of the object to fetch image data for.
aboxhall 2016/11/22 19:06:31 Typo "THe"
dmazzoni 2016/11/22 22:00:13 Done.
116 int image_data_node_id_ = -1;
117
118 gfx::Size max_image_data_size_;
104 119
105 // These are updated when calling |Freeze|. 120 // These are updated when calling |Freeze|.
106 bool frozen_; 121 bool frozen_ = false;
107 blink::WebDocument document_; 122 blink::WebDocument document_;
108 blink::WebAXObject root_; 123 blink::WebAXObject root_;
109 blink::WebAXObject focus_; 124 blink::WebAXObject focus_;
110 }; 125 };
111 126
112 } // namespace content 127 } // namespace content
113 128
114 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 129 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698