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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return false; | 93 return false; |
94 FloatQuad quad(toLayoutBox(layoutObject) | 94 FloatQuad quad(toLayoutBox(layoutObject) |
95 ->localToAbsoluteQuad(FloatQuad( | 95 ->localToAbsoluteQuad(FloatQuad( |
96 toLayoutBox(layoutObject)->borderBoundingBox()))); | 96 toLayoutBox(layoutObject)->borderBoundingBox()))); |
97 IntRect rect(quad.enclosingBoundingBox()); | 97 IntRect rect(quad.enclosingBoundingBox()); |
98 IntRect rectInViewport = | 98 IntRect rectInViewport = |
99 m_localFrame->view()->soonToBeRemovedContentsToUnscaledViewport(rect); | 99 m_localFrame->view()->soonToBeRemovedContentsToUnscaledViewport(rect); |
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 pend
ing to be shown for example). | 103 // The client might refuse to create a popup (when there is already one |
| 104 // pending to be shown for example). |
104 didCancel(); | 105 didCancel(); |
105 return false; | 106 return false; |
106 } | 107 } |
107 } | 108 } |
108 | 109 |
109 void ExternalPopupMenu::show() { | 110 void ExternalPopupMenu::show() { |
110 if (!showInternal()) | 111 if (!showInternal()) |
111 return; | 112 return; |
112 #if OS(MACOSX) | 113 #if OS(MACOSX) |
113 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); | 114 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (ownerElement.itemIsDisplayNone(*items[i])) | 298 if (ownerElement.itemIsDisplayNone(*items[i])) |
298 continue; | 299 continue; |
299 if (popupMenuItemIndex == i) | 300 if (popupMenuItemIndex == i) |
300 return indexTracker; | 301 return indexTracker; |
301 ++indexTracker; | 302 ++indexTracker; |
302 } | 303 } |
303 return -1; | 304 return -1; |
304 } | 305 } |
305 | 306 |
306 } // namespace blink | 307 } // namespace blink |
OLD | NEW |