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

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

Issue 22331005: Clean up accessibility enums for use in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reupload Created 7 years, 4 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) 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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 postNotification(node, AXSelectedChildrenChanged, false); 721 postNotification(node, AXSelectedChildrenChanged, false);
722 } 722 }
723 723
724 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) 724 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
725 { 725 {
726 // postToElement is false so that you can pass in any child of an element an d it will go up the parent tree 726 // postToElement is false so that you can pass in any child of an element an d it will go up the parent tree
727 // to find the container which should send out the notification. 727 // to find the container which should send out the notification.
728 postNotification(renderer, AXSelectedChildrenChanged, false); 728 postNotification(renderer, AXSelectedChildrenChanged, false);
729 } 729 }
730 730
731 void AXObjectCache::nodeTextChangeNotification(Node* node, AXTextChange textChan ge, unsigned offset, const String& text)
732 {
733 if (!node)
734 return;
735
736 stopCachingComputedObjectAttributes();
737
738 // Delegate on the right platform
739 AccessibilityObject* obj = getOrCreate(node);
740 nodeTextChangePlatformNotification(obj, textChange, offset, text);
741 }
742
743 void AXObjectCache::handleScrollbarUpdate(ScrollView* view) 731 void AXObjectCache::handleScrollbarUpdate(ScrollView* view)
744 { 732 {
745 if (!view) 733 if (!view)
746 return; 734 return;
747 735
748 // We don't want to create a scroll view from this method, only update an ex isting one. 736 // We don't want to create a scroll view from this method, only update an ex isting one.
749 if (AccessibilityObject* scrollViewObject = get(view)) { 737 if (AccessibilityObject* scrollViewObject = get(view)) {
750 stopCachingComputedObjectAttributes(); 738 stopCachingComputedObjectAttributes();
751 scrollViewObject->updateChildrenIfNecessary(); 739 scrollViewObject->updateChildrenIfNecessary();
752 } 740 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 obj = get(document->renderer()); 928 obj = get(document->renderer());
941 } 929 }
942 930
943 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF rameView()->frame() || !obj->documentFrameView()->frame()->page()) 931 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF rameView()->frame() || !obj->documentFrameView()->frame()->page())
944 return; 932 return;
945 933
946 ChromeClient* client = obj->documentFrameView()->frame()->page()->chrome().c lient(); 934 ChromeClient* client = obj->documentFrameView()->frame()->page()->chrome().c lient();
947 if (!client) 935 if (!client)
948 return; 936 return;
949 937
950 switch (notification) { 938 if (notification == AXActiveDescendantChanged
951 case AXActiveDescendantChanged: 939 && obj->document()->focusedElement()
952 if (!obj->document()->focusedElement() || (obj->node() != obj->document( )->focusedElement())) 940 && obj->node() == obj->document()->focusedElement()) {
953 break;
954
955 // Calling handleFocusedUIElementChanged will focus the new active 941 // Calling handleFocusedUIElementChanged will focus the new active
956 // descendant and send the AXFocusedUIElementChanged notification. 942 // descendant and send the AXFocusedUIElementChanged notification.
957 handleFocusedUIElementChanged(0, obj->document()->focusedElement()); 943 handleFocusedUIElementChanged(0, obj->document()->focusedElement());
958 break;
959 case AXAriaAttributeChanged:
960 case AXAutocorrectionOccured:
961 case AXCheckedStateChanged:
962 case AXChildrenChanged:
963 case AXFocusedUIElementChanged:
964 case AXInvalidStatusChanged:
965 case AXLayoutComplete:
966 case AXLiveRegionChanged:
967 case AXLoadComplete:
968 case AXMenuListItemSelected:
969 case AXMenuListValueChanged:
970 case AXRowCollapsed:
971 case AXRowCountChanged:
972 case AXRowExpanded:
973 case AXScrolledToAnchor:
974 case AXSelectedChildrenChanged:
975 case AXSelectedTextChanged:
976 case AXTextChanged:
977 case AXValueChanged:
978 break;
979 } 944 }
980 945
981 client->postAccessibilityNotification(obj, notification); 946 client->postAccessibilityNotification(obj, notification);
982 } 947 }
983 948
984 void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXT extChange, unsigned, const String&)
985 {
986 }
987
988 void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode) 949 void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode)
989 { 950 {
990 if (!newFocusedNode) 951 if (!newFocusedNode)
991 return; 952 return;
992 953
993 Page* page = newFocusedNode->document()->page(); 954 Page* page = newFocusedNode->document()->page();
994 if (!page) 955 if (!page)
995 return; 956 return;
996 957
997 AccessibilityObject* focusedObject = focusedUIElementForPage(page); 958 AccessibilityObject* focusedObject = focusedUIElementForPage(page);
998 if (!focusedObject) 959 if (!focusedObject)
999 return; 960 return;
1000 961
1001 postPlatformNotification(focusedObject, AXFocusedUIElementChanged); 962 postPlatformNotification(focusedObject, AXFocusedUIElementChanged);
1002 } 963 }
1003 964
1004 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) 965 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode)
1005 { 966 {
1006 // The anchor node may not be accessible. Post the notification for the 967 // The anchor node may not be accessible. Post the notification for the
1007 // first accessible object. 968 // first accessible object.
1008 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode( anchorNode), AXScrolledToAnchor); 969 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode( anchorNode), AXScrolledToAnchor);
1009 } 970 }
1010 971
1011 } // namespace WebCore 972 } // namespace WebCore
1012 973
1013 #endif // HAVE(ACCESSIBILITY) 974 #endif // HAVE(ACCESSIBILITY)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698