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

Side by Side Diff: Source/core/accessibility/AccessibilityARIAGrid.cpp

Issue 24752002: Cleanup <static_cast>: Switch to toFoo for Accessibility Objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re nderer) 50 PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re nderer)
51 { 51 {
52 return adoptRef(new AccessibilityARIAGrid(renderer)); 52 return adoptRef(new AccessibilityARIAGrid(renderer));
53 } 53 }
54 54
55 bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSe t<AccessibilityObject*>& appendedRows, unsigned& columnCount) 55 bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSe t<AccessibilityObject*>& appendedRows, unsigned& columnCount)
56 { 56 {
57 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) 57 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole)
58 return false; 58 return false;
59 59
60 AccessibilityTableRow* row = static_cast<AccessibilityTableRow*>(child); 60 AccessibilityTableRow* row = toAccessibilityTableRow(child);
61 if (appendedRows.contains(row)) 61 if (appendedRows.contains(row))
62 return false; 62 return false;
63 63
64 // store the maximum number of columns 64 // store the maximum number of columns
65 unsigned rowCellCount = row->children().size(); 65 unsigned rowCellCount = row->children().size();
66 if (rowCellCount > columnCount) 66 if (rowCellCount > columnCount)
67 columnCount = rowCellCount; 67 columnCount = rowCellCount;
68 68
69 row->setRowIndex((int)m_rows.size()); 69 row->setRowIndex((int)m_rows.size());
70 m_rows.append(row); 70 m_rows.append(row);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // This allows the table to dive arbitrarily deep to find the rows. 110 // This allows the table to dive arbitrarily deep to find the rows.
111 AccessibilityChildrenVector children = child->children(); 111 AccessibilityChildrenVector children = child->children();
112 size_t length = children.size(); 112 size_t length = children.size();
113 for (size_t i = 0; i < length; ++i) 113 for (size_t i = 0; i < length; ++i)
114 addTableCellChild(children[i].get(), appendedRows, columnCount); 114 addTableCellChild(children[i].get(), appendedRows, columnCount);
115 } 115 }
116 } 116 }
117 117
118 // make the columns based on the number of columns in the first body 118 // make the columns based on the number of columns in the first body
119 for (unsigned i = 0; i < columnCount; ++i) { 119 for (unsigned i = 0; i < columnCount; ++i) {
120 AccessibilityTableColumn* column = static_cast<AccessibilityTableColumn* >(axCache->getOrCreate(ColumnRole)); 120 AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache->g etOrCreate(ColumnRole));
121 column->setColumnIndex((int)i); 121 column->setColumnIndex((int)i);
122 column->setParent(this); 122 column->setParent(this);
123 m_columns.append(column); 123 m_columns.append(column);
124 if (!column->accessibilityIsIgnored()) 124 if (!column->accessibilityIsIgnored())
125 m_children.append(column); 125 m_children.append(column);
126 } 126 }
127 127
128 AccessibilityObject* headerContainerObject = headerContainer(); 128 AccessibilityObject* headerContainerObject = headerContainer();
129 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( )) 129 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( ))
130 m_children.append(headerContainerObject); 130 m_children.append(headerContainerObject);
131 } 131 }
132 132
133 } // namespace WebCore 133 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXObjectCache.cpp ('k') | Source/core/accessibility/AccessibilityARIAGridCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698