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

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

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (!m_haveChildren) 135 if (!m_haveChildren)
136 addChildren(); 136 addChildren();
137 } 137 }
138 138
139 void AXMenuListPopup::didUpdateActiveOption(int optionIndex) 139 void AXMenuListPopup::didUpdateActiveOption(int optionIndex)
140 { 140 {
141 updateChildrenIfNecessary(); 141 updateChildrenIfNecessary();
142 142
143 AXObjectCacheImpl* cache = axObjectCache(); 143 AXObjectCacheImpl* cache = axObjectCache();
144 if (m_activeIndex != optionIndex && m_activeIndex >= 0 && m_activeIndex < st atic_cast<int>(m_children.size())) { 144 if (m_activeIndex != optionIndex && m_activeIndex >= 0 && m_activeIndex < st atic_cast<int>(m_children.size())) {
145 RefPtr<AXObject> previousChild = m_children[m_activeIndex].get(); 145 RefPtrWillBeRawPtr<AXObject> previousChild = m_children[m_activeIndex].g et();
146 cache->postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuLi stItemUnselected); 146 cache->postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuLi stItemUnselected);
147 } 147 }
148 148
149 if (optionIndex >= 0 && optionIndex < static_cast<int>(m_children.size())) { 149 if (optionIndex >= 0 && optionIndex < static_cast<int>(m_children.size())) {
150 RefPtr<AXObject> child = m_children[optionIndex].get(); 150 RefPtrWillBeRawPtr<AXObject> child = m_children[optionIndex].get();
151 cache->postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIEleme ntChanged); 151 cache->postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIEleme ntChanged);
152 cache->postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSe lected); 152 cache->postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSe lected);
153 } 153 }
154 154
155 m_activeIndex = optionIndex; 155 m_activeIndex = optionIndex;
156 } 156 }
157 157
158 void AXMenuListPopup::didHide() 158 void AXMenuListPopup::didHide()
159 { 159 {
160 AXObjectCacheImpl* cache = axObjectCache(); 160 AXObjectCacheImpl* cache = axObjectCache();
(...skipping 18 matching lines...) Expand all
179 179
180 AXObject* AXMenuListPopup::activeChild() 180 AXObject* AXMenuListPopup::activeChild()
181 { 181 {
182 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() )) 182 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() ))
183 return nullptr; 183 return nullptr;
184 184
185 return m_children[m_activeIndex].get(); 185 return m_children[m_activeIndex].get();
186 } 186 }
187 187
188 } // namespace blink 188 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698