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

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, 6 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (!m_haveChildren) 134 if (!m_haveChildren)
135 addChildren(); 135 addChildren();
136 } 136 }
137 137
138 void AXMenuListPopup::didUpdateActiveOption(int optionIndex) 138 void AXMenuListPopup::didUpdateActiveOption(int optionIndex)
139 { 139 {
140 updateChildrenIfNecessary(); 140 updateChildrenIfNecessary();
141 141
142 AXObjectCacheImpl& cache = axObjectCache(); 142 AXObjectCacheImpl& cache = axObjectCache();
143 if (m_activeIndex != optionIndex && m_activeIndex >= 0 && m_activeIndex < st atic_cast<int>(m_children.size())) { 143 if (m_activeIndex != optionIndex && m_activeIndex >= 0 && m_activeIndex < st atic_cast<int>(m_children.size())) {
144 RefPtr<AXObject> previousChild = m_children[m_activeIndex].get(); 144 RefPtrWillBeRawPtr<AXObject> previousChild = m_children[m_activeIndex].g et();
145 cache.postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuLis tItemUnselected); 145 cache.postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuLis tItemUnselected);
146 } 146 }
147 147
148 if (optionIndex >= 0 && optionIndex < static_cast<int>(m_children.size())) { 148 if (optionIndex >= 0 && optionIndex < static_cast<int>(m_children.size())) {
149 RefPtr<AXObject> child = m_children[optionIndex].get(); 149 RefPtrWillBeRawPtr<AXObject> child = m_children[optionIndex].get();
150 cache.postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIElemen tChanged); 150 cache.postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIElemen tChanged);
151 cache.postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSel ected); 151 cache.postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSel ected);
152 } 152 }
153 153
154 m_activeIndex = optionIndex; 154 m_activeIndex = optionIndex;
155 } 155 }
156 156
157 void AXMenuListPopup::didHide() 157 void AXMenuListPopup::didHide()
158 { 158 {
159 AXObjectCacheImpl& cache = axObjectCache(); 159 AXObjectCacheImpl& cache = axObjectCache();
(...skipping 18 matching lines...) Expand all
178 178
179 AXObject* AXMenuListPopup::activeChild() 179 AXObject* AXMenuListPopup::activeChild()
180 { 180 {
181 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() )) 181 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() ))
182 return nullptr; 182 return nullptr;
183 183
184 return m_children[m_activeIndex].get(); 184 return m_children[m_activeIndex].get();
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXMenuListPopup.h ('k') | Source/modules/accessibility/AXNodeObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698