| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   74         return; |   74         return; | 
|   75     m_webExternalPopupMenu = m_webView.client()->createExternalPopupMenu(info, t
     his); |   75     m_webExternalPopupMenu = m_webView.client()->createExternalPopupMenu(info, t
     his); | 
|   76     if (m_webExternalPopupMenu) { |   76     if (m_webExternalPopupMenu) { | 
|   77         m_webExternalPopupMenu->show(m_frameView->contentsToWindow(rect)); |   77         m_webExternalPopupMenu->show(m_frameView->contentsToWindow(rect)); | 
|   78 #if OS(MACOSX) |   78 #if OS(MACOSX) | 
|   79         const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); |   79         const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); | 
|   80         if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { |   80         if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { | 
|   81             m_syntheticEvent = adoptPtr(new WebMouseEvent); |   81             m_syntheticEvent = adoptPtr(new WebMouseEvent); | 
|   82             *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent)
     ; |   82             *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent)
     ; | 
|   83             m_syntheticEvent->type = WebInputEvent::MouseUp; |   83             m_syntheticEvent->type = WebInputEvent::MouseUp; | 
|   84             m_dispatchEventTimer.startOneShot(0); |   84             m_dispatchEventTimer.startOneShot(0, FROM_HERE); | 
|   85             // FIXME: show() is asynchronous. If preparing a popup is slow and |   85             // FIXME: show() is asynchronous. If preparing a popup is slow and | 
|   86             // a user released the mouse button before showing the popup, |   86             // a user released the mouse button before showing the popup, | 
|   87             // mouseup and click events are correctly dispatched. Dispatching |   87             // mouseup and click events are correctly dispatched. Dispatching | 
|   88             // the synthetic mouseup event is redundant in this case. |   88             // the synthetic mouseup event is redundant in this case. | 
|   89         } |   89         } | 
|   90 #endif |   90 #endif | 
|   91     } else { |   91     } else { | 
|   92         // The client might refuse to create a popup (when there is already one 
     pending to be shown for example). |   92         // The client might refuse to create a popup (when there is already one 
     pending to be shown for example). | 
|   93         didCancel(); |   93         didCancel(); | 
|   94     } |   94     } | 
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  206  |  206  | 
|  207     info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh
     t(); |  207     info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh
     t(); | 
|  208     info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font().
     fontDescription().computedSize()); |  208     info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font().
     fontDescription().computedSize()); | 
|  209     info->selectedIndex = m_popupMenuClient->selectedIndex(); |  209     info->selectedIndex = m_popupMenuClient->selectedIndex(); | 
|  210     info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == WebCo
     re::RTL; |  210     info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == WebCo
     re::RTL; | 
|  211     info->allowMultipleSelection = m_popupMenuClient->multiple(); |  211     info->allowMultipleSelection = m_popupMenuClient->multiple(); | 
|  212     info->items.swap(items); |  212     info->items.swap(items); | 
|  213 } |  213 } | 
|  214  |  214  | 
|  215 } |  215 } | 
| OLD | NEW |