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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Displaying the context menu in this function is a big hack as we don't | 149 // Displaying the context menu in this function is a big hack as we don't |
150 // have context, i.e. whether this is being invoked via a script or in | 150 // have context, i.e. whether this is being invoked via a script or in |
151 // response to user input (Mouse event WM_RBUTTONDOWN, | 151 // response to user input (Mouse event WM_RBUTTONDOWN, |
152 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked | 152 // Keyboard events KeyVK_APPS, Shift+F10). Check if this is being invoked |
153 // in response to the above input events before popping up the context menu. | 153 // in response to the above input events before popping up the context menu. |
154 if (!ContextMenuAllowedScope::isContextMenuAllowed()) | 154 if (!ContextMenuAllowedScope::isContextMenuAllowed()) |
155 return false; | 155 return false; |
156 | 156 |
157 HitTestResult r = m_webView->page()->contextMenuController().hitTestResult(); | 157 HitTestResult r = m_webView->page()->contextMenuController().hitTestResult(); |
158 | 158 |
159 r.setToShadowHostIfInUserAgentShadowRoot(); | 159 r.setToShadowHostIfInRestrictedShadowRoot(); |
160 | 160 |
161 LocalFrame* selectedFrame = r.innerNodeFrame(); | 161 LocalFrame* selectedFrame = r.innerNodeFrame(); |
162 | 162 |
163 WebContextMenuData data; | 163 WebContextMenuData data; |
164 data.mousePosition = selectedFrame->view()->contentsToViewport( | 164 data.mousePosition = selectedFrame->view()->contentsToViewport( |
165 r.roundedPointInInnerNodeFrame()); | 165 r.roundedPointInInnerNodeFrame()); |
166 | 166 |
167 // Compute edit flags. | 167 // Compute edit flags. |
168 data.editFlags = WebContextMenuData::CanDoNone; | 168 data.editFlags = WebContextMenuData::CanDoNone; |
169 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canUndo()) | 169 if (toLocalFrame(m_webView->focusedCoreFrame())->editor().canUndo()) |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 subMenuItems.swap(outputItems); | 448 subMenuItems.swap(outputItems); |
449 } | 449 } |
450 | 450 |
451 void ContextMenuClientImpl::populateCustomMenuItems( | 451 void ContextMenuClientImpl::populateCustomMenuItems( |
452 const ContextMenu* defaultMenu, | 452 const ContextMenu* defaultMenu, |
453 WebContextMenuData* data) { | 453 WebContextMenuData* data) { |
454 populateSubMenuItems(defaultMenu->items(), data->customItems); | 454 populateSubMenuItems(defaultMenu->items(), data->customItems); |
455 } | 455 } |
456 | 456 |
457 } // namespace blink | 457 } // namespace blink |
OLD | NEW |