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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // show a popup. | 99 // show a popup. |
100 m_webExternalPopupMenu->show(rectInViewport); | 100 m_webExternalPopupMenu->show(rectInViewport); |
101 return true; | 101 return true; |
102 } else { | 102 } else { |
103 // The client might refuse to create a popup (when there is already one
pending to be shown for example). | 103 // The client might refuse to create a popup (when there is already one
pending to be shown for example). |
104 didCancel(); | 104 didCancel(); |
105 return false; | 105 return false; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void ExternalPopupMenu::show() | 109 void ExternalPopupMenu::show(const FloatQuad&, const IntSize&, int) |
110 { | 110 { |
111 if (!showInternal()) | 111 if (!showInternal()) |
112 return; | 112 return; |
113 #if OS(MACOSX) | 113 #if OS(MACOSX) |
114 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); | 114 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); |
115 if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { | 115 if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { |
116 m_syntheticEvent = adoptPtr(new WebMouseEvent); | 116 m_syntheticEvent = adoptPtr(new WebMouseEvent); |
117 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); | 117 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); |
118 m_syntheticEvent->type = WebInputEvent::MouseUp; | 118 m_syntheticEvent->type = WebInputEvent::MouseUp; |
119 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); | 119 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if (ownerElement.itemIsDisplayNone(*items[i])) | 292 if (ownerElement.itemIsDisplayNone(*items[i])) |
293 continue; | 293 continue; |
294 if (popupMenuItemIndex == i) | 294 if (popupMenuItemIndex == i) |
295 return indexTracker; | 295 return indexTracker; |
296 ++indexTracker; | 296 ++indexTracker; |
297 } | 297 } |
298 return -1; | 298 return -1; |
299 } | 299 } |
300 | 300 |
301 } // namespace blink | 301 } // namespace blink |
OLD | NEW |