| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // Displaying the context menu in this function is a big hack as we don't | 183 // Displaying the context menu in this function is a big hack as we don't |
| 184 // have context, i.e. whether this is being invoked via a script or in | 184 // have context, i.e. whether this is being invoked via a script or in |
| 185 // response to user input (Mouse event WM_RBUTTONDOWN, | 185 // response to user input (Mouse event WM_RBUTTONDOWN, |
| 186 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked | 186 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked |
| 187 // in response to the above input events before popping up the context menu. | 187 // in response to the above input events before popping up the context menu. |
| 188 if (!m_webView->contextMenuAllowed()) | 188 if (!m_webView->contextMenuAllowed()) |
| 189 return; | 189 return; |
| 190 | 190 |
| 191 HitTestResult r = m_webView->page()->contextMenuController().hitTestResult()
; | 191 HitTestResult r = m_webView->page()->contextMenuController().hitTestResult()
; |
| 192 | 192 |
| 193 r.setToShadowHostIfInUserAgentShadowRoot(); | 193 r.setToShadowHostIfInClosedShadowRoot(); |
| 194 | 194 |
| 195 LocalFrame* selectedFrame = r.innerNodeFrame(); | 195 LocalFrame* selectedFrame = r.innerNodeFrame(); |
| 196 | 196 |
| 197 WebContextMenuData data; | 197 WebContextMenuData data; |
| 198 IntPoint mousePoint = selectedFrame->view()->contentsToWindow(r.roundedPoint
InInnerNodeFrame()); | 198 IntPoint mousePoint = selectedFrame->view()->contentsToWindow(r.roundedPoint
InInnerNodeFrame()); |
| 199 | 199 |
| 200 // FIXME(bokan): crbug.com/371902 - We shouldn't be making these scale | 200 // FIXME(bokan): crbug.com/371902 - We shouldn't be making these scale |
| 201 // related coordinate transformatios in an ad hoc way. | 201 // related coordinate transformatios in an ad hoc way. |
| 202 PinchViewport& pinchViewport = selectedFrame->host()->pinchViewport(); | 202 PinchViewport& pinchViewport = selectedFrame->host()->pinchViewport(); |
| 203 mousePoint -= flooredIntSize(pinchViewport.visibleRect().location()); | 203 mousePoint -= flooredIntSize(pinchViewport.visibleRect().location()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 outputItems[i] = subItems[i]; | 444 outputItems[i] = subItems[i]; |
| 445 subMenuItems.swap(outputItems); | 445 subMenuItems.swap(outputItems); |
| 446 } | 446 } |
| 447 | 447 |
| 448 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) | 448 void ContextMenuClientImpl::populateCustomMenuItems(const ContextMenu* defaultMe
nu, WebContextMenuData* data) |
| 449 { | 449 { |
| 450 populateSubMenuItems(defaultMenu->items(), data->customItems); | 450 populateSubMenuItems(defaultMenu->items(), data->customItems); |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace blink | 453 } // namespace blink |
| OLD | NEW |