summaryrefslogtreecommitdiffstats
path: root/WebKit/win/WebView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/win/WebView.cpp')
-rw-r--r--WebKit/win/WebView.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 20c8d17..1b658bf 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -1245,12 +1245,14 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
if (!handledEvent)
return false;
+ ContextMenuController* contextMenuController = m_page->contextMenuController();
+
// Show the menu
- ContextMenu* coreMenu = m_page->contextMenuController()->contextMenu();
+ ContextMenu* coreMenu = contextMenuController->contextMenu();
if (!coreMenu)
return false;
- Node* node = coreMenu->hitTestResult().innerNonSharedNode();
+ Node* node = contextMenuController->hitTestResult().innerNonSharedNode();
if (!node)
return false;
@@ -1262,7 +1264,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
if (!view)
return false;
- POINT point(view->contentsToWindow(coreMenu->hitTestResult().point()));
+ POINT point(view->contentsToWindow(contextMenuController->hitTestResult().point()));
// Translate the point to screen coordinates
if (!::ClientToScreen(m_viewWindow, &point))
@@ -1273,12 +1275,12 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
m_uiDelegate->hasCustomMenuImplementation(&hasCustomMenus);
if (hasCustomMenus)
- m_uiDelegate->trackCustomPopupMenu((IWebView*)this, (OLE_HANDLE)(ULONG64)coreMenu->platformDescription(), &point);
+ m_uiDelegate->trackCustomPopupMenu((IWebView*)this, (OLE_HANDLE)(ULONG64)coreMenu->nativeMenu(), &point);
else {
// Surprisingly, TPM_RIGHTBUTTON means that items are selectable with either the right OR left mouse button
UINT flags = TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_VERPOSANIMATION | TPM_HORIZONTAL
| TPM_LEFTALIGN | TPM_HORPOSANIMATION;
- ::TrackPopupMenuEx(coreMenu->platformDescription(), flags, point.x, point.y, m_viewWindow, 0);
+ ::TrackPopupMenuEx(coreMenu->nativeMenu(), flags, point.x, point.y, m_viewWindow, 0);
}
return true;
@@ -1353,11 +1355,10 @@ void WebView::performContextMenuAction(WPARAM wParam, LPARAM lParam, bool byPosi
ContextMenu* menu = m_page->contextMenuController()->contextMenu();
ASSERT(menu);
- ContextMenuItem* item = byPosition ? menu->itemAtIndex((unsigned)wParam, (HMENU)lParam) : menu->itemWithAction((ContextMenuAction)wParam);
+ ContextMenuItem* item = byPosition ? menu->itemAtIndex((unsigned)wParam) : menu->itemWithAction((ContextMenuAction)wParam);
if (!item)
return;
m_page->contextMenuController()->contextMenuItemSelected(item);
- delete item;
}
bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)