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

Side by Side Diff: Source/modules/accessibility/AXMenuList.cpp

Issue 1059503002: Re-land: Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: Fix optgroup Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (list->accessibilityIsIgnored()) { 86 if (list->accessibilityIsIgnored()) {
87 cache->remove(list->axObjectID()); 87 cache->remove(list->axObjectID());
88 return; 88 return;
89 } 89 }
90 90
91 m_children.append(list); 91 m_children.append(list);
92 92
93 list->addChildren(); 93 list->addChildren();
94 } 94 }
95 95
96 void AXMenuList::childrenChanged()
97 {
98 if (m_children.isEmpty())
99 return;
100
101 ASSERT(m_children.size() == 1);
102 m_children[0]->childrenChanged();
103 }
104
105 bool AXMenuList::isCollapsed() const 96 bool AXMenuList::isCollapsed() const
106 { 97 {
107 return !toLayoutMenuList(m_layoutObject)->popupIsVisible(); 98 return !toLayoutMenuList(m_layoutObject)->popupIsVisible();
108 } 99 }
109 100
110 AccessibilityExpanded AXMenuList::isExpanded() const 101 AccessibilityExpanded AXMenuList::isExpanded() const
111 { 102 {
112 if (isCollapsed()) 103 if (isCollapsed())
113 return ExpandedCollapsed; 104 return ExpandedCollapsed;
114 105
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return; 145 return;
155 146
156 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); 147 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
157 popup->didHide(); 148 popup->didHide();
158 149
159 if (node() && node()->focused()) 150 if (node() && node()->focused())
160 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXFocusedUIEl ementChanged); 151 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXFocusedUIEl ementChanged);
161 } 152 }
162 153
163 } // namespace blink 154 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXMenuList.h ('k') | Source/modules/accessibility/AXMenuListOption.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698