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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 bool ExternalPopupMenu::showInternal() { | 77 bool ExternalPopupMenu::showInternal() { |
78 // Blink core reuses the PopupMenu of an element. For simplicity, we do | 78 // Blink core reuses the PopupMenu of an element. For simplicity, we do |
79 // recreate the actual external popup everytime. | 79 // recreate the actual external popup everytime. |
80 if (m_webExternalPopupMenu) { | 80 if (m_webExternalPopupMenu) { |
81 m_webExternalPopupMenu->close(); | 81 m_webExternalPopupMenu->close(); |
82 m_webExternalPopupMenu = 0; | 82 m_webExternalPopupMenu = 0; |
83 } | 83 } |
84 | 84 |
85 WebPopupMenuInfo info; | 85 WebPopupMenuInfo info; |
86 getPopupMenuInfo(info, *m_ownerElement); | 86 getPopupMenuInfo(info, *m_ownerElement); |
87 if (info.items.isEmpty()) | 87 if (info.items.empty()) |
88 return false; | 88 return false; |
89 WebLocalFrameImpl* webframe = | 89 WebLocalFrameImpl* webframe = |
90 WebLocalFrameImpl::fromFrame(m_localFrame.get()); | 90 WebLocalFrameImpl::fromFrame(m_localFrame.get()); |
91 m_webExternalPopupMenu = | 91 m_webExternalPopupMenu = |
92 webframe->client()->createExternalPopupMenu(info, this); | 92 webframe->client()->createExternalPopupMenu(info, this); |
93 if (m_webExternalPopupMenu) { | 93 if (m_webExternalPopupMenu) { |
94 LayoutObject* layoutObject = m_ownerElement->layoutObject(); | 94 LayoutObject* layoutObject = m_ownerElement->layoutObject(); |
95 if (!layoutObject || !layoutObject->isBox()) | 95 if (!layoutObject || !layoutObject->isBox()) |
96 return false; | 96 return false; |
97 FloatQuad quad(toLayoutBox(layoutObject) | 97 FloatQuad quad(toLayoutBox(layoutObject) |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 if (ownerElement.itemIsDisplayNone(*items[i])) | 303 if (ownerElement.itemIsDisplayNone(*items[i])) |
304 continue; | 304 continue; |
305 if (popupMenuItemIndex == i) | 305 if (popupMenuItemIndex == i) |
306 return indexTracker; | 306 return indexTracker; |
307 ++indexTracker; | 307 ++indexTracker; |
308 } | 308 } |
309 return -1; | 309 return -1; |
310 } | 310 } |
311 | 311 |
312 } // namespace blink | 312 } // namespace blink |
OLD | NEW |