| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool AXMenuList::press() const | 53 bool AXMenuList::press() const |
| 54 { | 54 { |
| 55 LayoutMenuList* menuList = toLayoutMenuList(m_layoutObject); | 55 LayoutMenuList* menuList = toLayoutMenuList(m_layoutObject); |
| 56 if (menuList->popupIsVisible()) | 56 if (menuList->popupIsVisible()) |
| 57 menuList->hidePopup(); | 57 menuList->hidePopup(); |
| 58 else | 58 else |
| 59 menuList->showPopup(); | 59 menuList->showPopup(); |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void AXMenuList::updateChildrenIfNecessary() |
| 64 { |
| 65 if (m_children.isEmpty()) { |
| 66 addChildren(); |
| 67 return; |
| 68 } |
| 69 |
| 70 // There's no reason to update our AXMenuListPopup child. If we get a |
| 71 // call to updateChildrenIfNecessary, it's because the options might have |
| 72 // changed, so call it on our popup. |
| 73 ASSERT(m_children.size() == 1); |
| 74 m_children[0]->updateChildrenIfNecessary(); |
| 75 } |
| 76 |
| 63 void AXMenuList::clearChildren() | 77 void AXMenuList::clearChildren() |
| 64 { | 78 { |
| 65 if (m_children.isEmpty()) | 79 if (m_children.isEmpty()) |
| 66 return; | 80 return; |
| 67 | 81 |
| 68 // There's no reason to clear our AXMenuListPopup child. If we get a | 82 // There's no reason to clear our AXMenuListPopup child. If we get a |
| 69 // call to clearChildren, it's because the options might have changed, | 83 // call to clearChildren, it's because the options might have changed, |
| 70 // so call it on our popup. | 84 // so call it on our popup. |
| 71 ASSERT(m_children.size() == 1); | 85 ASSERT(m_children.size() == 1); |
| 72 m_children[0]->clearChildren(); | 86 m_children[0]->clearChildren(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return; | 168 return; |
| 155 | 169 |
| 156 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); | 170 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); |
| 157 popup->didHide(); | 171 popup->didHide(); |
| 158 | 172 |
| 159 if (node() && node()->focused()) | 173 if (node() && node()->focused()) |
| 160 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXFocusedUIEl
ementChanged); | 174 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXFocusedUIEl
ementChanged); |
| 161 } | 175 } |
| 162 | 176 |
| 163 } // namespace blink | 177 } // namespace blink |
| OLD | NEW |