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

Side by Side Diff: components/pdf/renderer/pdf_accessibility_tree.cc

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. Created 3 years, 7 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 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversion_utils.h" 9 #include "base/strings/utf_string_conversion_utils.h"
10 #include "components/pdf/renderer/pdf_accessibility_tree.h" 10 #include "components/pdf/renderer/pdf_accessibility_tree.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height); 268 return gfx::RectF(r.point.x, r.point.y, r.size.width, r.size.height);
269 } 269 }
270 270
271 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) { 271 ui::AXNodeData* PdfAccessibilityTree::CreateNode(ui::AXRole role) {
272 content::RenderAccessibility* render_accessibility = GetRenderAccessibility(); 272 content::RenderAccessibility* render_accessibility = GetRenderAccessibility();
273 DCHECK(render_accessibility); 273 DCHECK(render_accessibility);
274 274
275 ui::AXNodeData* node = new ui::AXNodeData(); 275 ui::AXNodeData* node = new ui::AXNodeData();
276 node->id = render_accessibility->GenerateAXID(); 276 node->id = render_accessibility->GenerateAXID();
277 node->role = role; 277 node->role = role;
278 node->state = 1 << ui::AX_STATE_READ_ONLY; 278 node->AddState(ui::AX_STATE_READ_ONLY);
279 279
280 // All nodes other than the first one have coordinates relative to 280 // All nodes other than the first one have coordinates relative to
281 // the first node. 281 // the first node.
282 if (nodes_.size() > 0) 282 if (nodes_.size() > 0)
283 node->offset_container_id = nodes_[0]->id; 283 node->offset_container_id = nodes_[0]->id;
284 284
285 nodes_.push_back(base::WrapUnique(node)); 285 nodes_.push_back(base::WrapUnique(node));
286 286
287 return node; 287 return node;
288 } 288 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 const ui::AXNode* PdfAccessibilityTree::GetNull() const { 352 const ui::AXNode* PdfAccessibilityTree::GetNull() const {
353 return nullptr; 353 return nullptr;
354 } 354 }
355 355
356 void PdfAccessibilityTree::SerializeNode( 356 void PdfAccessibilityTree::SerializeNode(
357 const ui::AXNode* node, ui::AXNodeData* out_data) const { 357 const ui::AXNode* node, ui::AXNodeData* out_data) const {
358 *out_data = node->data(); 358 *out_data = node->data();
359 } 359 }
360 360
361 } // namespace pdf 361 } // namespace pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698