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

Side by Side Diff: ui/accessibility/ax_tree_combiner.cc

Issue 2154213007: Replace gfx::Rect with gfx::RectF in ui::AXNodeData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win compile Created 4 years, 5 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_node_data.h ('k') | ui/accessibility/ax_tree_combiner_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/accessibility/ax_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 #include "ui/accessibility/ax_tree_combiner.h" 6 #include "ui/accessibility/ax_tree_combiner.h"
7 #include "ui/gfx/geometry/rect_f.h" 7 #include "ui/gfx/geometry/rect_f.h"
8 8
9 namespace ui { 9 namespace ui {
10 namespace { 10 namespace {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 for (size_t j = 0; j < node.intlist_attributes.size(); ++j) { 201 for (size_t j = 0; j < node.intlist_attributes.size(); ++j) {
202 auto& attr = node.intlist_attributes[j]; 202 auto& attr = node.intlist_attributes[j];
203 if (IsNodeIdIntListAttribute(attr.first)) { 203 if (IsNodeIdIntListAttribute(attr.first)) {
204 for (size_t k = 0; k < attr.second.size(); k++) 204 for (size_t k = 0; k < attr.second.size(); k++)
205 attr.second[k] = MapId(tree_id, attr.second[k]); 205 attr.second[k] = MapId(tree_id, attr.second[k]);
206 } 206 }
207 } 207 }
208 208
209 // Apply the transformation to the object's bounds to put it in 209 // Apply the transformation to the object's bounds to put it in
210 // the coordinate space of the root frame. 210 // the coordinate space of the root frame.
211 gfx::RectF boundsf(node.location); 211 transform_.TransformRect(&node.location);
212 transform_.TransformRect(&boundsf);
213 node.location = gfx::Rect(boundsf.x(), boundsf.y(),
214 boundsf.width(), boundsf.height());
215 212
216 // See if this node has a child tree. As a sanity check make sure the 213 // See if this node has a child tree. As a sanity check make sure the
217 // child tree lists this tree as its parent tree id. 214 // child tree lists this tree as its parent tree id.
218 const AXTreeUpdate* child_tree = nullptr; 215 const AXTreeUpdate* child_tree = nullptr;
219 if (tree_id_map_.find(child_tree_id) != tree_id_map_.end()) { 216 if (tree_id_map_.find(child_tree_id) != tree_id_map_.end()) {
220 child_tree = tree_id_map_.find(child_tree_id)->second; 217 child_tree = tree_id_map_.find(child_tree_id)->second;
221 if (child_tree->tree_data.parent_tree_id != tree_id) 218 if (child_tree->tree_data.parent_tree_id != tree_id)
222 child_tree = nullptr; 219 child_tree = nullptr;
223 if (child_tree && child_tree->nodes.empty()) 220 if (child_tree && child_tree->nodes.empty())
224 child_tree = nullptr; 221 child_tree = nullptr;
225 if (child_tree) { 222 if (child_tree) {
226 node.child_ids.push_back(MapId(child_tree_id, 223 node.child_ids.push_back(MapId(child_tree_id,
227 child_tree->nodes[0].id)); 224 child_tree->nodes[0].id));
228 } 225 }
229 } 226 }
230 227
231 // Put the rewritten AXNodeData into the output data structure. 228 // Put the rewritten AXNodeData into the output data structure.
232 combined_.nodes.push_back(node); 229 combined_.nodes.push_back(node);
233 230
234 // Recurse into the child tree now, if any. 231 // Recurse into the child tree now, if any.
235 if (child_tree) 232 if (child_tree)
236 ProcessTree(child_tree); 233 ProcessTree(child_tree);
237 } 234 }
238 235
239 // Reset the transform. 236 // Reset the transform.
240 transform_ = old_transform; 237 transform_ = old_transform;
241 } 238 }
242 239
243 } // namespace ui 240 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node_data.h ('k') | ui/accessibility/ax_tree_combiner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698