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

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 2816273002: Implement GetParent, GetChildCount, ChildAtIndex on BrowserAccessibility (Closed)
Patch Set: stray semi Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 bounds.Offset(-sx, -sy); 1127 bounds.Offset(-sx, -sy);
1128 } 1128 }
1129 } 1129 }
1130 1130
1131 node = container; 1131 node = container;
1132 } 1132 }
1133 1133
1134 return gfx::ToEnclosingRect(bounds); 1134 return gfx::ToEnclosingRect(bounds);
1135 } 1135 }
1136 1136
1137 // AXPlatformNodeDelegate. 1137 // AXPlatformNodeDelegate.
dmazzoni 2017/04/21 16:22:27 nit: make this a larger block comment like we have
1138 const ui::AXNodeData& BrowserAccessibility::GetData() const { 1138 const ui::AXNodeData& BrowserAccessibility::GetData() const {
1139 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); 1139 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ());
1140 if (node_) 1140 if (node_)
1141 return node_->data(); 1141 return node_->data();
1142 else 1142 else
1143 return empty_data; 1143 return empty_data;
1144 } 1144 }
1145 1145
1146 gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() { 1146 gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() {
1147 NOTREACHED(); 1147 NOTREACHED();
1148 return nullptr; 1148 return nullptr;
1149 } 1149 }
1150 1150
1151 gfx::NativeViewAccessible BrowserAccessibility::GetParent() { 1151 gfx::NativeViewAccessible BrowserAccessibility::GetParent() {
1152 NOTREACHED(); 1152 auto* parent = PlatformGetParent();
1153 if (parent && parent->platform_node_)
1154 return parent->platform_node_->GetNativeViewAccessible();
1153 return nullptr; 1155 return nullptr;
1154 } 1156 }
1155 1157
1156 int BrowserAccessibility::GetChildCount() { 1158 int BrowserAccessibility::GetChildCount() {
1157 NOTREACHED(); 1159 return PlatformChildCount();
1158 return -1;
1159 } 1160 }
1160 1161
1161 gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) { 1162 gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) {
1162 NOTREACHED(); 1163 auto* child = PlatformGetChild(index);
1164 if (child && child->platform_node_)
1165 return child->platform_node_->GetNativeViewAccessible();
1163 return nullptr; 1166 return nullptr;
1164 } 1167 }
1165 1168
1166 gfx::Rect BrowserAccessibility::GetScreenBoundsRect() const { 1169 gfx::Rect BrowserAccessibility::GetScreenBoundsRect() const {
1167 gfx::Rect bounds = GetPageBoundsRect(); 1170 gfx::Rect bounds = GetPageBoundsRect();
1168 1171
1169 // Adjust the bounds by the top left corner of the containing view's bounds 1172 // Adjust the bounds by the top left corner of the containing view's bounds
1170 // in screen coordinates. 1173 // in screen coordinates.
1171 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); 1174 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin());
1172 1175
(...skipping 16 matching lines...) Expand all
1189 return gfx::kNullAcceleratedWidget; 1192 return gfx::kNullAcceleratedWidget;
1190 } 1193 }
1191 1194
1192 bool BrowserAccessibility::AccessibilityPerformAction( 1195 bool BrowserAccessibility::AccessibilityPerformAction(
1193 const ui::AXActionData& data) { 1196 const ui::AXActionData& data) {
1194 NOTREACHED(); 1197 NOTREACHED();
1195 return false; 1198 return false;
1196 } 1199 }
1197 1200
1198 } // namespace content 1201 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698