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

Side by Side Diff: Source/core/accessibility/AXObjectCache.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
« no previous file with comments | « no previous file | Source/core/accessibility/AccessibilityARIAGrid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (!axRenderImage) 141 if (!axRenderImage)
142 return 0; 142 return 0;
143 143
144 AccessibilityObject::AccessibilityChildrenVector imageChildren = axRenderIma ge->children(); 144 AccessibilityObject::AccessibilityChildrenVector imageChildren = axRenderIma ge->children();
145 unsigned count = imageChildren.size(); 145 unsigned count = imageChildren.size();
146 for (unsigned k = 0; k < count; ++k) { 146 for (unsigned k = 0; k < count; ++k) {
147 AccessibilityObject* child = imageChildren[k].get(); 147 AccessibilityObject* child = imageChildren[k].get();
148 if (!child->isImageMapLink()) 148 if (!child->isImageMapLink())
149 continue; 149 continue;
150 150
151 if (static_cast<AccessibilityImageMapLink*>(child)->areaElement() == are aElement) 151 if (toAccessibilityImageMapLink(child)->areaElement() == areaElement)
152 return child; 152 return child;
153 } 153 }
154 154
155 return 0; 155 return 0;
156 } 156 }
157 157
158 AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page) 158 AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page)
159 { 159 {
160 if (!gAccessibilityEnabled) 160 if (!gAccessibilityEnabled)
161 return 0; 161 return 0;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if (!widget) 312 if (!widget)
313 return 0; 313 return 0;
314 314
315 if (AccessibilityObject* obj = get(widget)) 315 if (AccessibilityObject* obj = get(widget))
316 return obj; 316 return obj;
317 317
318 RefPtr<AccessibilityObject> newObj = 0; 318 RefPtr<AccessibilityObject> newObj = 0;
319 if (widget->isFrameView()) 319 if (widget->isFrameView())
320 newObj = AccessibilityScrollView::create(toScrollView(widget)); 320 newObj = AccessibilityScrollView::create(toScrollView(widget));
321 else if (widget->isScrollbar()) 321 else if (widget->isScrollbar())
322 newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget)) ; 322 newObj = AccessibilityScrollbar::create(toScrollbar(widget));
323 323
324 // Will crash later if we have two objects for the same widget. 324 // Will crash later if we have two objects for the same widget.
325 ASSERT(!get(widget)); 325 ASSERT(!get(widget));
326 326
327 getAXID(newObj.get()); 327 getAXID(newObj.get());
328 328
329 m_widgetObjectMapping.set(widget, newObj->axObjectID()); 329 m_widgetObjectMapping.set(widget, newObj->axObjectID());
330 m_objects.set(newObj->axObjectID(), newObj); 330 m_objects.set(newObj->axObjectID(), newObj);
331 newObj->init(); 331 newObj->init();
332 attachWrapper(newObj.get()); 332 attachWrapper(newObj.get());
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 917
918 void AXObjectCache::attachWrapper(AccessibilityObject*) 918 void AXObjectCache::attachWrapper(AccessibilityObject*)
919 { 919 {
920 // In Chromium, AccessibilityObjects are not wrapped. 920 // In Chromium, AccessibilityObjects are not wrapped.
921 } 921 }
922 922
923 void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific ation notification) 923 void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific ation notification)
924 { 924 {
925 if (obj && obj->isAccessibilityScrollbar() && notification == AXValueChanged ) { 925 if (obj && obj->isAccessibilityScrollbar() && notification == AXValueChanged ) {
926 // Send document value changed on scrollbar value changed notification. 926 // Send document value changed on scrollbar value changed notification.
927 Scrollbar* scrollBar = static_cast<AccessibilityScrollbar*>(obj)->scroll bar(); 927 Scrollbar* scrollBar = toAccessibilityScrollbar(obj)->scrollbar();
928 if (!scrollBar || !scrollBar->parent() || !scrollBar->parent()->isFrameV iew()) 928 if (!scrollBar || !scrollBar->parent() || !scrollBar->parent()->isFrameV iew())
929 return; 929 return;
930 Document* document = toFrameView(scrollBar->parent())->frame().document( ); 930 Document* document = toFrameView(scrollBar->parent())->frame().document( );
931 if (document != document->topDocument()) 931 if (document != document->topDocument())
932 return; 932 return;
933 obj = get(document->renderer()); 933 obj = get(document->renderer());
934 } 934 }
935 935
936 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF rameView()->frame().page()) 936 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF rameView()->frame().page())
937 return; 937 return;
(...skipping 30 matching lines...) Expand all
968 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) 968 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode)
969 { 969 {
970 // The anchor node may not be accessible. Post the notification for the 970 // The anchor node may not be accessible. Post the notification for the
971 // first accessible object. 971 // first accessible object.
972 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode( anchorNode), AXScrolledToAnchor); 972 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode( anchorNode), AXScrolledToAnchor);
973 } 973 }
974 974
975 } // namespace WebCore 975 } // namespace WebCore
976 976
977 #endif // HAVE(ACCESSIBILITY) 977 #endif // HAVE(ACCESSIBILITY)
OLDNEW
« no previous file with comments | « no previous file | Source/core/accessibility/AccessibilityARIAGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698