OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 void ExternalPopupMenu::updateFromElement(UpdateReason reason) { | 142 void ExternalPopupMenu::updateFromElement(UpdateReason reason) { |
143 switch (reason) { | 143 switch (reason) { |
144 case BySelectionChange: | 144 case BySelectionChange: |
145 case ByDOMChange: | 145 case ByDOMChange: |
146 if (m_needsUpdate) | 146 if (m_needsUpdate) |
147 return; | 147 return; |
148 m_needsUpdate = true; | 148 m_needsUpdate = true; |
149 TaskRunnerHelper::get(TaskType::UserInteraction, | 149 TaskRunnerHelper::get(TaskType::UserInteraction, |
150 &m_ownerElement->document()) | 150 &m_ownerElement->document()) |
151 ->postTask(BLINK_FROM_HERE, WTF::bind(&ExternalPopupMenu::update, | 151 ->postTask( |
152 wrapPersistent(this))); | 152 BLINK_FROM_HERE, |
| 153 WTF::bind(&ExternalPopupMenu::update, wrapPersistent(this))); |
153 break; | 154 break; |
154 | 155 |
155 case ByStyleChange: | 156 case ByStyleChange: |
156 // TOOD(tkent): We should update the popup location/content in some | 157 // TOOD(tkent): We should update the popup location/content in some |
157 // cases. e.g. Updating ComputedStyle of the SELECT element affects | 158 // cases. e.g. Updating ComputedStyle of the SELECT element affects |
158 // popup position and OPTION style. | 159 // popup position and OPTION style. |
159 break; | 160 break; |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 if (ownerElement.itemIsDisplayNone(*items[i])) | 302 if (ownerElement.itemIsDisplayNone(*items[i])) |
302 continue; | 303 continue; |
303 if (popupMenuItemIndex == i) | 304 if (popupMenuItemIndex == i) |
304 return indexTracker; | 305 return indexTracker; |
305 ++indexTracker; | 306 ++indexTracker; |
306 } | 307 } |
307 return -1; | 308 return -1; |
308 } | 309 } |
309 | 310 |
310 } // namespace blink | 311 } // namespace blink |
OLD | NEW |