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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return false; | 105 return false; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void ExternalPopupMenu::show() { | 109 void ExternalPopupMenu::show() { |
110 if (!showInternal()) | 110 if (!showInternal()) |
111 return; | 111 return; |
112 #if OS(MACOSX) | 112 #if OS(MACOSX) |
113 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); | 113 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); |
114 if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { | 114 if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { |
115 m_syntheticEvent = wrapUnique(new WebMouseEvent); | 115 m_syntheticEvent = WTF::wrapUnique(new WebMouseEvent); |
116 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); | 116 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); |
117 m_syntheticEvent->type = WebInputEvent::MouseUp; | 117 m_syntheticEvent->type = WebInputEvent::MouseUp; |
118 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); | 118 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); |
119 // FIXME: show() is asynchronous. If preparing a popup is slow and a | 119 // FIXME: show() is asynchronous. If preparing a popup is slow and a |
120 // user released the mouse button before showing the popup, mouseup and | 120 // user released the mouse button before showing the popup, mouseup and |
121 // click events are correctly dispatched. Dispatching the synthetic | 121 // click events are correctly dispatched. Dispatching the synthetic |
122 // mouseup event is redundant in this case. | 122 // mouseup event is redundant in this case. |
123 } | 123 } |
124 #endif | 124 #endif |
125 } | 125 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if (ownerElement.itemIsDisplayNone(*items[i])) | 299 if (ownerElement.itemIsDisplayNone(*items[i])) |
300 continue; | 300 continue; |
301 if (popupMenuItemIndex == i) | 301 if (popupMenuItemIndex == i) |
302 return indexTracker; | 302 return indexTracker; |
303 ++indexTracker; | 303 ++indexTracker; |
304 } | 304 } |
305 return -1; | 305 return -1; |
306 } | 306 } |
307 | 307 |
308 } // namespace blink | 308 } // namespace blink |
OLD | NEW |