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

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

Issue 2759113004: Make BrowserAccessibility implement AXPlatformNodeDelegete. (Closed)
Patch Set: Rebase, remove one of the GetData() methods, and update the declaration of GetData to be const Created 3 years, 9 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 | « content/browser/accessibility/browser_accessibility.h ('k') | 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 10
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 329
330 int32_t BrowserAccessibility::GetIndexInParent() const { 330 int32_t BrowserAccessibility::GetIndexInParent() const {
331 return node_ ? node_->index_in_parent() : -1; 331 return node_ ? node_->index_in_parent() : -1;
332 } 332 }
333 333
334 int32_t BrowserAccessibility::GetId() const { 334 int32_t BrowserAccessibility::GetId() const {
335 return node_ ? node_->id() : -1; 335 return node_ ? node_->id() : -1;
336 } 336 }
337 337
338 const ui::AXNodeData& BrowserAccessibility::GetData() const {
339 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ());
340 if (node_)
341 return node_->data();
342 else
343 return empty_data;
344 }
345
346 gfx::RectF BrowserAccessibility::GetLocation() const { 338 gfx::RectF BrowserAccessibility::GetLocation() const {
347 return GetData().location; 339 return GetData().location;
348 } 340 }
349 341
350 ui::AXRole BrowserAccessibility::GetRole() const { 342 ui::AXRole BrowserAccessibility::GetRole() const {
351 return GetData().role; 343 return GetData().role;
352 } 344 }
353 345
354 int32_t BrowserAccessibility::GetState() const { 346 int32_t BrowserAccessibility::GetState() const {
355 return GetData().state; 347 return GetData().state;
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 bounds.Offset(-sx, -sy); 1208 bounds.Offset(-sx, -sy);
1217 } 1209 }
1218 } 1210 }
1219 1211
1220 node = container; 1212 node = container;
1221 } 1213 }
1222 1214
1223 return gfx::ToEnclosingRect(bounds); 1215 return gfx::ToEnclosingRect(bounds);
1224 } 1216 }
1225 1217
1218 // AXPlatformNodeDelegate.
1219 const ui::AXNodeData& BrowserAccessibility::GetData() const {
1220 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ());
1221 if (node_)
1222 return node_->data();
1223 else
1224 return empty_data;
1225 }
1226
1227 gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() {
1228 NOTREACHED();
1229 return nullptr;
1230 }
1231
1232 gfx::NativeViewAccessible BrowserAccessibility::GetParent() {
1233 NOTREACHED();
1234 return nullptr;
1235 }
1236
1237 int BrowserAccessibility::GetChildCount() {
1238 NOTREACHED();
1239 return -1;
1240 }
1241
1242 gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) {
1243 NOTREACHED();
1244 return nullptr;
1245 }
1246
1247 gfx::Vector2d BrowserAccessibility::GetGlobalCoordinateOffset() {
1248 NOTREACHED();
1249 return gfx::Vector2d();
1250 }
1251
1252 gfx::NativeViewAccessible BrowserAccessibility::HitTestSync(int x, int y) {
1253 NOTREACHED();
1254 return nullptr;
1255 }
1256
1257 gfx::NativeViewAccessible BrowserAccessibility::GetFocus() {
1258 NOTREACHED();
1259 return nullptr;
1260 }
1261
1262 gfx::AcceleratedWidget
1263 BrowserAccessibility::GetTargetForNativeAccessibilityEvent() {
1264 NOTREACHED();
1265 return gfx::kNullAcceleratedWidget;
1266 }
1267
1268 bool BrowserAccessibility::AccessibilityPerformAction(
1269 const ui::AXActionData& data) {
1270 NOTREACHED();
1271 return false;
1272 }
1273
1274 void BrowserAccessibility::DoDefaultAction() {
1275 NOTREACHED();
1276 }
1277
1226 } // namespace content 1278 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698